Skip to content

Commit

Permalink
core: fix safari weirdness on async methods and window open
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Feb 25, 2023
1 parent 0bdb402 commit 3812ad9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions plugins/core/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scrypted/core",
"version": "0.1.92",
"version": "0.1.93",
"description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.",
"author": "Scrypted",
"license": "Apache-2.0",
Expand Down
8 changes: 6 additions & 2 deletions plugins/core/ui/src/interfaces/OauthClient.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export default {
}
},
onClick: function () {
// https://stackoverflow.com/a/39387533
const windowReference = this.isIFrame() ? window.open(undefined, '_blank') : undefined;
this.rpc()
.getOauthUrl()
.then(data => {
Expand Down Expand Up @@ -47,8 +49,10 @@ export default {
r: window.location.toString(),
});
url.search = qs.stringify(querystring);
const target = this.isIFrame() ? '_blank' : undefined;
window.open(url.toString(), target);
if (windowReference)
windowReference.location = url.toString();
else
window.location = url.toString();
});
}
}
Expand Down

0 comments on commit 3812ad9

Please sign in to comment.