Skip to content

Commit

Permalink
fix-return-wrong-error (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
duyphanz authored Mar 5, 2020
1 parent 021a985 commit 3c0be7e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "can-pass-js",
"version": "1.0.2",
"version": "1.0.3",
"description": "Can Pass API SDK",
"files": [
"dist",
Expand Down
4 changes: 2 additions & 2 deletions src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export const graphql = (body: {
.then(res => res.json())
.then(response => {
if (response.errors) {
return response.errors;
throw response.errors;
} else {
throw response.data;
return response.data;
}
})
.catch(err => {
Expand Down
2 changes: 1 addition & 1 deletion src/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const popup = (URL: string): Promise<any> => {
window[eventRemoveMethod](messageEvent, eventHandler, false);
if (currentWindow) {
currentWindow.close();
currentWindow = null;
delete window[window[CURRENT_WINDOW]];
}
if (authWindow) authWindow.close();
};
Expand Down

0 comments on commit 3c0be7e

Please sign in to comment.