Remove locking mechanism from loadMenus method
This commit is contained in:
parent
f82b137c10
commit
a35fc05e7f
1 changed files with 0 additions and 7 deletions
|
|
@ -33,7 +33,6 @@ export class mzta_Menus {
|
||||||
menu_context_display = null;
|
menu_context_display = null;
|
||||||
menu_listeners = {};
|
menu_listeners = {};
|
||||||
logger = null;
|
logger = null;
|
||||||
lock = false;
|
|
||||||
|
|
||||||
rootMenu = [
|
rootMenu = [
|
||||||
//{ id: 'ItemC', act: (info, tab) => { console.log('ItemC', info, tab, info.menuItemId); alert('ItemC') } },
|
//{ id: 'ItemC', act: (info, tab) => { console.log('ItemC', info, tab, info.menuItemId); alert('ItemC') } },
|
||||||
|
|
@ -247,16 +246,10 @@ export class mzta_Menus {
|
||||||
}
|
}
|
||||||
|
|
||||||
async loadMenus(also_special = []) {
|
async loadMenus(also_special = []) {
|
||||||
while (this.lock) {
|
|
||||||
this.logger.log("Waiting for the lock to be released...");
|
|
||||||
await new Promise((resolve) => setTimeout(resolve, 100)); // Wait for the lock to be released
|
|
||||||
}
|
|
||||||
this.lock = true;
|
|
||||||
await this.initialize(also_special);
|
await this.initialize(also_special);
|
||||||
await this.addMenu(this.rootMenu);
|
await this.addMenu(this.rootMenu);
|
||||||
this.addClickListener();
|
this.addClickListener();
|
||||||
this.loadShortcutMenu();
|
this.loadShortcutMenu();
|
||||||
this.lock = false;
|
|
||||||
this.logger.log("Menus loaded");
|
this.logger.log("Menus loaded");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue