diff --git a/gui/scripts/alerts.js b/gui/scripts/alerts.js index 4ebdbdd..2f48f6e 100644 --- a/gui/scripts/alerts.js +++ b/gui/scripts/alerts.js @@ -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; }