moved reader to avoid re-importing per function
This commit is contained in:
parent
9b9a6372c6
commit
3a49487556
1 changed files with 6 additions and 13 deletions
|
@ -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;
|
||||
|
||||
(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`),
|
||||
static async confirm(MESSAGE) {
|
||||
let user_response = confirm(
|
||||
reader.localized((MESSAGE) ? MESSAGE : `GUI_alert_confirm_action_text`),
|
||||
);
|
||||
})();
|
||||
|
||||
// Return the user response.
|
||||
return user_response;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue