Skip to content

Commit d4f10cf

Browse files
authored
Merge pull request #72 from farfromrefug/master
update demo and fix packaging
2 parents fe70864 + 2a1bc45 commit d4f10cf

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

demo/app/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import * as application from 'tns-core-modules/application';
1+
import * as application from '@nativescript/core/application';
22

33
application.run({moduleName: "main-page"});

demo/app/main-page.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as Https from "nativescript-https";
2-
import * as Observable from "tns-core-modules/data/observable";
3-
import * as fs from "tns-core-modules/file-system";
4-
import * as dialogs from "tns-core-modules/ui/dialogs";
5-
import * as Page from "tns-core-modules/ui/page";
2+
import * as Observable from "@nativescript/core/data/observable";
3+
import * as fs from "@nativescript/core/file-system";
4+
import * as dialogs from "@nativescript/core/ui/dialogs";
5+
import * as Page from "@nativescript/core/ui/page";
66

77
let page;
88
let viewModel;

demo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"nativescript-https": "file:../src",
1313
"nativescript-theme-core": "^1.0.4",
1414
"nativescript-unit-test-runner": "0.7.0",
15-
"tns-core-modules": "~6.4.0"
15+
"@nativescript/core": "~6.4.0"
1616
},
1717
"devDependencies": {
1818
"nativescript-css-loader": "~0.26.1",

src/https.ios.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@ function AFFailure(
392392
let parsedData = getData(data);
393393
const failingURL = error.userInfo.objectForKey("NSErrorFailingURLKey");
394394
if (useLegacy) {
395+
if (!sendi.statusCode) {
396+
return reject(error.localizedDescription);
397+
}
395398
let failure: any = {
396399
description: error.description,
397400
reason: error.localizedDescription,
@@ -404,7 +407,6 @@ function AFFailure(
404407
}
405408
sendi.failure = failure;
406409
sendi.content = new HttpsResponse(data, url);
407-
408410
resolve(sendi);
409411
} else {
410412
let content: any = {
@@ -529,7 +531,7 @@ export function createRequest(
529531
run(resolve, reject) {
530532
const success = function (task: NSURLSessionDataTask, data?: any) {
531533
// TODO: refactor this code with failure one.
532-
let content = useLegacy
534+
let content = useLegacy
533535
? new HttpsResponse(data, opts.url)
534536
: getData(data);
535537
let getHeaders = () => ({});

0 commit comments

Comments
 (0)