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()});
}
async onRefresh() {
const DATA = await Tabs.query(null, 0)
if (DATA.url) {
(!!await check.platform(DATA.url))
? (this.enable())
: (this.disable())
};
onRefresh() {
(Tabs.query(null, 0)).then((DATA) => {
if (DATA ? (DATA.url) : false) {
(check.platform(DATA.url)).then((result) => {
(result) ? (this.enable()) : (this.disable())
});
};
})
}
/*