Skip to content

Tbozhikov/fix response code ios #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 4, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
chore: cleanup
  • Loading branch information
tbozhikov committed Jun 4, 2019
commit 187ece4bb7131731c5bf2d2f7d09b2afe2a78f0e
15 changes: 1 addition & 14 deletions src/background-http.ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function onError(session, nsTask, error) {
const fileManager = utils.ios.getter(NSFileManager, NSFileManager.defaultManager);
fileManager.removeItemAtPathError(task._fileToCleanup);
}
let response = nsTask && nsTask.performSelector("response") ? <NSHTTPURLResponse>nsTask.performSelector("response") : null;
const response = nsTask && <NSHTTPURLResponse>nsTask.performSelector("response");
if (error) {
task.notifyPropertyChange("status", task.status);
task.notify(<common.ErrorEventData>{
Expand Down Expand Up @@ -319,19 +319,6 @@ class Task extends Observable {
public cancel(): void {
this._task.cancel();
}

private readProp<T>(object: NSObject, prop: string, type: interop.Type<T>): T {
const sig = object.methodSignatureForSelector(prop);
const invocation = NSInvocation.invocationWithMethodSignature(sig);
invocation.selector = prop;

invocation.invokeWithTarget(object);

const ret = new interop.Reference<T>(type, new interop.Pointer());
invocation.getReturnValue(ret);

return ret.value;
}
}

export function session(id: string): common.Session {
Expand Down