moved reader to avoid re-importing per function

This commit is contained in:
buzzcode2007 2024-04-08 20:24:05 +08:00
parent 9b9a6372c6
commit 3a49487556

View file

@ -2,21 +2,14 @@
Alert management system.
*/
const reader = (await import(chrome.runtime.getURL("gui/scripts/read.js"))).default;
export default class alerts {
static confirm_action() {
let user_response = false;
static async confirm(MESSAGE) {
let user_response = confirm(
reader.localized((MESSAGE) ? MESSAGE : `GUI_alert_confirm_action_text`),
);
(async () => {
// Import the module.
let reader = (await import(chrome.runtime.getURL("gui/scripts/read.js")))[
`texts`
];
// Get the user response.
user_response = confirm(
reader.localized(`GUI_alert_confirm_action_text`),
);
})();
// Return the user response.
return user_response;
}