Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,118 @@
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>

<activity-alias
android:name=".MainActivityIconPrism"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_acode_prism"
android:roundIcon="@mipmap/ic_acode_prism_round"
android:label="@string/app_name"
android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>

<activity-alias
android:name=".MainActivityIconPorcelain"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_acode_porcelain"
android:roundIcon="@mipmap/ic_acode_porcelain_round"
android:label="@string/app_name"
android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>

<activity-alias
android:name=".MainActivityIconTangerine"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_acode_tangerine"
android:roundIcon="@mipmap/ic_acode_tangerine_round"
android:label="@string/app_name"
android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>

<activity-alias
android:name=".MainActivityIconTidal"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_acode_tidal"
android:roundIcon="@mipmap/ic_acode_tidal_round"
android:label="@string/app_name"
android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>

<activity-alias
android:name=".MainActivityIconLilac"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_acode_lilac"
android:roundIcon="@mipmap/ic_acode_lilac_round"
android:label="@string/app_name"
android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>

<activity-alias
android:name=".MainActivityIconVolt"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_acode_volt"
android:roundIcon="@mipmap/ic_acode_volt_round"
android:label="@string/app_name"
android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>

<activity-alias
android:name=".MainActivityIconCobalt"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_acode_cobalt"
android:roundIcon="@mipmap/ic_acode_cobalt_round"
android:label="@string/app_name"
android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>

<activity-alias
android:name=".MainActivityIconGlacier"
android:enabled="false"
android:exported="true"
android:icon="@mipmap/ic_acode_glacier"
android:roundIcon="@mipmap/ic_acode_glacier_round"
android:label="@string/app_name"
android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
</config-file>

<config-file target="AndroidManifest.xml" parent="/manifest">
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"cordova-plugin-system": "file:src/plugins/system",
"cordova-plugin-websocket": "file:src/plugins/websocket",
"css-loader": "^7.1.4",
"elementtree": "^0.1.7",
"happy-dom": "^20.11.6",
"mini-css-extract-plugin": "^2.10.2",
"path-browserify": "^1.0.1",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions res/android/drawable/ic_acode_collection_monochrome.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<?xml version='1.0' encoding='utf-8'?>
<vector android:height="108dp" android:viewportHeight="108" android:viewportWidth="108" android:width="108dp" xmlns:android="http://schemas.android.com/apk/res/android"><group android:scaleX="0.09225" android:scaleY="0.09225" android:translateX="28.86328125" android:translateY="33.1171875"><path android:fillColor="#FFFFFF" android:pathData="m216.9 55.7c1.54-9.11 9.61-17.98 16.49-17.98h42.28c9.31 0 17.81 11.45 15 25.95-16.32 84.09-48.75 253.82-63.92 334.21-2.15 11.4-10.51 17.02-16.04 17.02h-36.49c-7.06 0-17.09-9.66-15.71-17.67C176.66 292.05 202.34 141.61 216.9 55.7Z" /><path android:fillColor="#FFFFFF" android:pathData="m327.13 55.71c-1.54-9.11-9.61-17.98-16.49-17.98h-42.28c-9.31 0-17.81 11.45-15 25.95 16.32 84.09 48.75 253.82 63.92 334.21 2.15 11.4 10.51 17.02 16.04 17.02h36.49c7.06 0 17.09-9.66 15.71-17.67-18.15-105.18-43.83-255.62-58.39-341.53Z" /><path android:fillColor="#FFFFFF" android:pathData="M438.86 233.19c-4.64-4.84-53.34-55.72-70.25-72.53-6.23-6.19-6.23-16.45-3.45-23.32 2.17-5.36 8.75-11.32 15.15-11.29h46.31c4.16 0 7.87 2.18 11.59 5.95 20.31 20.55 59 60.43 80.61 83.36 1.44 1.52 2.93 2.88 4.1 4.12 3.54 3.75 4.64 8.13 4.84 11.56.09.93.13 1.8.15 2.58.09 3.59-.81 8.86-4.99 13.27-1.17 1.24-2.66 2.6-4.1 4.12-21.61 22.93-60.3 62.81-80.61 83.36-3.72 3.77-7.43 5.95-11.59 5.95h-46.31c-6.4.03-12.98-5.93-15.15-11.29-2.78-6.87-2.78-17.13 3.45-23.32 16.92-16.79 65.62-67.67 70.25-72.52Z" /><path android:fillColor="#FFFFFF" android:pathData="M105.51 233.77c4.64-4.84 53.34-55.72 70.25-72.53 6.23-6.19 6.23-16.45 3.45-23.32-2.17-5.36-8.75-11.32-15.15-11.29h-46.31c-4.16 0-7.87 2.18-11.59 5.95-20.31 20.55-59 60.43-80.61 83.36-1.44 1.52-2.93 2.88-4.1 4.12-3.54 3.75-4.64 8.13-4.84 11.56-.09.93-.13 1.8-.15 2.58-.09 3.59.81 8.86 4.99 13.27 1.17 1.24 2.66 2.6 4.1 4.12 21.61 22.93 60.3 62.81 80.61 83.36 3.72 3.77 7.43 5.95 11.59 5.95h46.31c6.4.03 12.98-5.93 15.15-11.29 2.78-6.87 2.78-17.13-3.45-23.32-16.91-16.8-65.61-67.68-70.25-72.52Z" /></group></vector>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_cobalt.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_cobalt_background"/>
<foreground android:drawable="@drawable/ic_acode_cobalt_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_cobalt_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_cobalt_background"/>
<foreground android:drawable="@drawable/ic_acode_cobalt_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_glacier.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_glacier_background"/>
<foreground android:drawable="@drawable/ic_acode_glacier_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_glacier_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_glacier_background"/>
<foreground android:drawable="@drawable/ic_acode_glacier_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_lilac.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_lilac_background"/>
<foreground android:drawable="@drawable/ic_acode_lilac_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_lilac_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_lilac_background"/>
<foreground android:drawable="@drawable/ic_acode_lilac_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_porcelain.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_porcelain_background"/>
<foreground android:drawable="@drawable/ic_acode_porcelain_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_porcelain_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_porcelain_background"/>
<foreground android:drawable="@drawable/ic_acode_porcelain_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_prism.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_prism_background"/>
<foreground android:drawable="@drawable/ic_acode_prism_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_prism_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_prism_background"/>
<foreground android:drawable="@drawable/ic_acode_prism_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_tangerine.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_tangerine_background"/>
<foreground android:drawable="@drawable/ic_acode_tangerine_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_tangerine_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_tangerine_background"/>
<foreground android:drawable="@drawable/ic_acode_tangerine_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_tidal.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_tidal_background"/>
<foreground android:drawable="@drawable/ic_acode_tidal_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_tidal_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_tidal_background"/>
<foreground android:drawable="@drawable/ic_acode_tidal_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_volt.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_volt_background"/>
<foreground android:drawable="@drawable/ic_acode_volt_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
6 changes: 6 additions & 0 deletions res/android/mipmap-anydpi-v26/ic_acode_volt_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_acode_volt_background"/>
<foreground android:drawable="@drawable/ic_acode_volt_foreground"/>
<monochrome android:drawable="@drawable/ic_acode_collection_monochrome"/>
</adaptive-icon>
Binary file added res/android/mipmap-hdpi/ic_acode_cobalt.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/android/mipmap-hdpi/ic_acode_glacier.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/android/mipmap-hdpi/ic_acode_lilac.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/android/mipmap-hdpi/ic_acode_lilac_round.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/android/mipmap-hdpi/ic_acode_porcelain.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/android/mipmap-hdpi/ic_acode_prism.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added res/android/mipmap-hdpi/ic_acode_prism_round.webp
Binary file added res/android/mipmap-hdpi/ic_acode_tangerine.webp
Binary file added res/android/mipmap-hdpi/ic_acode_tidal.webp
Binary file added res/android/mipmap-hdpi/ic_acode_tidal_round.webp
Binary file added res/android/mipmap-hdpi/ic_acode_volt.webp
Binary file added res/android/mipmap-hdpi/ic_acode_volt_round.webp
Binary file added res/android/mipmap-mdpi/ic_acode_cobalt.webp
Binary file added res/android/mipmap-mdpi/ic_acode_glacier.webp
Binary file added res/android/mipmap-mdpi/ic_acode_lilac.webp
Binary file added res/android/mipmap-mdpi/ic_acode_lilac_round.webp
Binary file added res/android/mipmap-mdpi/ic_acode_porcelain.webp
Binary file added res/android/mipmap-mdpi/ic_acode_prism.webp
Binary file added res/android/mipmap-mdpi/ic_acode_prism_round.webp
Binary file added res/android/mipmap-mdpi/ic_acode_tangerine.webp
Binary file added res/android/mipmap-mdpi/ic_acode_tidal.webp
Binary file added res/android/mipmap-mdpi/ic_acode_tidal_round.webp
Binary file added res/android/mipmap-mdpi/ic_acode_volt.webp
Binary file added res/android/mipmap-mdpi/ic_acode_volt_round.webp
Binary file added res/android/mipmap-xhdpi/ic_acode_cobalt.webp
Binary file added res/android/mipmap-xhdpi/ic_acode_glacier.webp
Binary file added res/android/mipmap-xhdpi/ic_acode_lilac.webp
Binary file added res/android/mipmap-xhdpi/ic_acode_porcelain.webp
Binary file added res/android/mipmap-xhdpi/ic_acode_prism.webp
Binary file added res/android/mipmap-xhdpi/ic_acode_tangerine.webp
Binary file added res/android/mipmap-xhdpi/ic_acode_tidal.webp
Binary file added res/android/mipmap-xhdpi/ic_acode_volt.webp
Binary file added res/android/mipmap-xxhdpi/ic_acode_cobalt.webp
Binary file added res/android/mipmap-xxhdpi/ic_acode_glacier.webp
Binary file added res/android/mipmap-xxhdpi/ic_acode_lilac.webp
Binary file added res/android/mipmap-xxhdpi/ic_acode_porcelain.webp
Binary file added res/android/mipmap-xxhdpi/ic_acode_prism.webp
Binary file added res/android/mipmap-xxhdpi/ic_acode_tangerine.webp
Binary file added res/android/mipmap-xxhdpi/ic_acode_tidal.webp
Binary file added res/android/mipmap-xxhdpi/ic_acode_volt.webp
Binary file added res/android/mipmap-xxxhdpi/ic_acode_glacier.webp
Binary file added res/android/mipmap-xxxhdpi/ic_acode_lilac.webp
Binary file added res/android/mipmap-xxxhdpi/ic_acode_prism.webp
Binary file added res/android/mipmap-xxxhdpi/ic_acode_tidal.webp
Binary file added res/android/mipmap-xxxhdpi/ic_acode_volt.webp
67 changes: 30 additions & 37 deletions src/dialogs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import restoreTheme from "lib/restoreTheme";
let loaderIsImmortal = false;
let onCancelCallback = null;
let cancelButtonTimeout = null;
let destroyTimeout = null;
let $currentDialog = null;
let $currentMask = null;
const titleLoaderId = "__title-loader";
Expand Down Expand Up @@ -39,16 +40,18 @@ function create(titleText, message = "", options = {}) {
titleText = "";
}

const $oldLoader = tag.get("#__loader");
const $oldMask = tag.get("#__loader-mask");

if ($oldLoader) $oldLoader.remove();
clearTimeout(destroyTimeout);
destroyTimeout = null;
const replacingActiveLoader =
$currentDialog && !$currentDialog.classList.contains("hide");
$currentDialog?.remove();
$currentMask?.remove();

const $message = Ref();
const $titleSpan = Ref();

const $mask = $oldMask || <span className="mask" id="__loader-mask"></span>;
const $dialog = $oldLoader || (
const $mask = <span className="mask" id="__loader-mask"></span>;
const $dialog = (
<div className="prompt alert" id="__loader">
<strong ref={$titleSpan} className="title">
{titleText}
Expand Down Expand Up @@ -82,11 +85,11 @@ function create(titleText, message = "", options = {}) {
}, options.timeout);
}

if (!$oldLoader) {
actionStack.freeze();
document.body.append($dialog, $mask);
restoreTheme(true);
}
$currentDialog = $dialog;
$currentMask = $mask;
actionStack.freeze();
document.body.append($dialog, $mask);
if (!replacingActiveLoader) restoreTheme(true);

return {
setTitle(title) {
Expand Down Expand Up @@ -124,54 +127,44 @@ function createTitleLoader() {
* Removes the loader from DOM permanently
*/
function destroy() {
const loaderDiv = tag.get("#__loader");
const mask = tag.get("#__loader-mask");
const loaderDiv = $currentDialog;
const mask = $currentMask;
clearTimeout(cancelButtonTimeout);
cancelButtonTimeout = null;
onCancelCallback = null;
if (!loaderDiv || loaderDiv.classList.contains("hide")) return;
restoreTheme();

if (!loaderDiv && !mask) {
actionStack.unfreeze();
return;
}

loaderDiv?.classList.add("hide");
setTimeout(() => {
loaderDiv.classList.add("hide");
destroyTimeout = setTimeout(() => {
// A newer loader must retain its dialog and Back/Escape lock.
if ($currentDialog !== loaderDiv) return;
destroyTimeout = null;
loaderDiv.remove();
mask?.remove();
$currentDialog = null;
$currentMask = null;
actionStack.unfreeze();
if (loaderDiv?.isConnected) loaderDiv.remove();
if (mask?.isConnected) mask.remove();
}, 300);
}

/**
* Hides the loading dialog box temporarily and can be restored using show method
*/
function hide() {
const loaderDiv = tag.get("#__loader");
const mask = tag.get("#__loader-mask");

if (loaderDiv) {
$currentDialog = loaderDiv;
loaderDiv.remove();
}
if (mask) {
$currentMask = mask;
mask.remove();
}
$currentDialog?.remove();
$currentMask?.remove();
}

/**
* Shows previously hidden dialog box.
*/
function show() {
if ($currentDialog) {
if ($currentDialog && !$currentDialog.isConnected) {
app.append($currentDialog);
$currentDialog = null;
}
if ($currentMask) {
if ($currentMask && !$currentMask.isConnected) {
app.append($currentMask);
$currentMask = null;
}
}

Expand Down
Loading