Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Commit

Permalink
Popup proxy improvements (#764)
Browse files Browse the repository at this point in the history
* Fix incorrect function invocations

* Ignore setVisibleOverride when it returns null

* Omit redundant async

* Change default return value
  • Loading branch information
toasted-nutbread authored Sep 4, 2020
1 parent 8d53474 commit 95bfe2d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ext/fg/js/popup-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class PopupFactory {
promises.push(promise);
}

const results = await Promise.all(promises);
const results = (await Promise.all(promises)).filter(({token}) => token !== null);

if (errors.length === 0) {
const token = generateId(16);
Expand Down
14 changes: 7 additions & 7 deletions ext/fg/js/popup-proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ class PopupProxy extends EventDispatcher {
return this._invokeSafe('isVisible', {id: this._id}, false);
}

async setVisibleOverride(value, priority) {
return this._invokeSafe('setVisibleOverride', {id: this._id, value, priority});
setVisibleOverride(value, priority) {
return this._invokeSafe('setVisibleOverride', {id: this._id, value, priority}, null);
}

async clearVisibleOverride(token) {
return this._invokeSafe('clearVisibleOverride', {id: this._id, token});
clearVisibleOverride(token) {
return this._invokeSafe('clearVisibleOverride', {id: this._id, token}, false);
}

async containsPoint(x, y) {
Expand Down Expand Up @@ -135,12 +135,12 @@ class PopupProxy extends EventDispatcher {
return this._invokeSafe('updateTheme', {id: this._id});
}

async setCustomOuterCss(css, useWebExtensionApi) {
return this._invokeSafe('updateTheme', {id: this._id, css, useWebExtensionApi});
setCustomOuterCss(css, useWebExtensionApi) {
return this._invokeSafe('setCustomOuterCss', {id: this._id, css, useWebExtensionApi});
}

setChildrenSupported(value) {
return this._invokeSafe('updateTheme', {id: this._id, value});
return this._invokeSafe('setChildrenSupported', {id: this._id, value});
}

getFrameRect() {
Expand Down

0 comments on commit 95bfe2d

Please sign in to comment.