Migrate some more things to typescript
This commit is contained in:
parent
6a1f07d881
commit
ede570865f
@ -1,3 +0,0 @@
|
||||
export async function sleep(timeout) {
|
||||
return new Promise( (resolve, reject) => setTimeout(() => resolve(), timeout));
|
||||
}
|
3
src/common/js/utils.ts
Normal file
3
src/common/js/utils.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export async function sleep(timeout) {
|
||||
return new Promise<void>( (resolve, reject) => setTimeout(() => resolve(), timeout));
|
||||
}
|
@ -1,6 +1,10 @@
|
||||
import Comms from '../../ext/lib/comms/Comms';
|
||||
import { browser } from '../../../node_modules/webextension-polyfill-ts/lib/index';
|
||||
import Settings from '../../ext/lib/Settings';
|
||||
|
||||
class ExecAction {
|
||||
settings: Settings;
|
||||
site: any;
|
||||
|
||||
constructor(settings, site) {
|
||||
this.settings = settings;
|
||||
this.site = site;
|
||||
@ -24,7 +28,7 @@ class ExecAction {
|
||||
arg: cmd.arg,
|
||||
customArg: cmd.customArg
|
||||
}
|
||||
Comms.sendMessage(message);
|
||||
browser.runtime.sendMessage(message);
|
||||
} else {
|
||||
|
||||
// set-ar-persistence sends stuff to content scripts as well (!)
|
||||
@ -41,7 +45,7 @@ class ExecAction {
|
||||
}
|
||||
// this hopefully delays settings.save() until current crops are saved on the site
|
||||
// and thus avoid any fucky-wuckies
|
||||
await Comms.sendMessage(message);
|
||||
await browser.runtime.sendMessage(message);
|
||||
}
|
||||
|
||||
let site = this.site;
|
Loading…
Reference in New Issue
Block a user