rewrite onRefresh to use callbacks

This commit is contained in:
buzz-lightsnack-2007 2024-04-27 16:35:06 +08:00
parent 4581ec76f3
commit 0ba207623d

View file

@ -27,14 +27,14 @@ export default class EntryManager {
Window.addActionListener(`onFocusChanged`, (data) => {this.onRefresh()}); Window.addActionListener(`onFocusChanged`, (data) => {this.onRefresh()});
} }
async onRefresh() { onRefresh() {
const DATA = await Tabs.query(null, 0) (Tabs.query(null, 0)).then((DATA) => {
if (DATA ? (DATA.url) : false) {
if (DATA.url) { (check.platform(DATA.url)).then((result) => {
(!!await check.platform(DATA.url)) (result) ? (this.enable()) : (this.disable())
? (this.enable()) });
: (this.disable())
}; };
})
} }
/* /*