Push updates to open receiver selectors

This commit is contained in:
hensm
2020-08-09 17:04:08 +01:00
parent 2bd9c4071f
commit f002acad8c
7 changed files with 50 additions and 19 deletions

View File

@@ -115,6 +115,16 @@ export default class PopupReceiverSelector extends ReceiverSelector {
}
}
public update (receivers: Receiver[]) {
this.receivers = receivers;
this.messagePort?.postMessage({
subject: "popup:/populateReceiverList"
, data: {
receivers: this.receivers
}
});
}
public async close (): Promise<void> {
if (this.windowId) {
await browser.windows.remove(this.windowId);