mirror of
https://github.com/danbulant/dribbblish-dynamic-theme
synced 2026-05-24 12:35:05 +00:00
add ability for loading screen to be disabled
This commit is contained in:
parent
f0a562f70a
commit
4b251dfa8d
3 changed files with 11 additions and 3 deletions
|
|
@ -1,5 +1,5 @@
|
|||
Added:
|
||||
- A spinning loader at startup while spotify is not ready
|
||||
- A spinning loader at startup while spotify is not ready (Can be disabled in settings)
|
||||
|
||||
Fixed:
|
||||
- Checking for update every 10 Minutes not working
|
||||
|
|
|
|||
|
|
@ -442,7 +442,7 @@ export default class ConfigMenu {
|
|||
const val = JSON.parse(this.#config[key]?.storageCache ?? localStorage.getItem(`dribbblish:config:${key}`) ?? null); // Turn undefined into null because `JSON.parse()` dosen't like undefined
|
||||
if (val == null || val?.type != this.#config[key]?.type) {
|
||||
localStorage.removeItem(`dribbblish:config:${key}`);
|
||||
return defaultValueOverride ?? this.#config[key].defaultValue;
|
||||
return defaultValueOverride ?? this.#config[key]?.defaultValue;
|
||||
}
|
||||
return val.value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,9 +19,17 @@ window.Dribbblish = Dribbblish;
|
|||
|
||||
const colorThief = new ColorThief();
|
||||
|
||||
Dribbblish.config.register({
|
||||
type: "checkbox",
|
||||
key: "showLoadingScreen",
|
||||
name: "Show Loading Screen",
|
||||
description: "Show a loading screen at startup while things are loaded in the background",
|
||||
defaultValue: true
|
||||
});
|
||||
|
||||
// In the future maybe have some useful info here
|
||||
const loadingHints = ["Getting things ready...", "Starting up...", "Just one moment..."];
|
||||
Dribbblish.loader.show(randomFromArray(loadingHints));
|
||||
if (Dribbblish.config.get("showLoadingScreen")) Dribbblish.loader.show(randomFromArray(loadingHints));
|
||||
|
||||
Dribbblish.on("ready", () => {
|
||||
setTimeout(() => Dribbblish.loader.hide(), 3000);
|
||||
|
|
|
|||
Loading…
Reference in a new issue