staticWindowTitle(fix): Order alphabetically on all appearances, change if to a ternary

This commit is contained in:
Darío Marmie 2024-10-23 09:39:13 -03:00
parent cb8667bd41
commit 974877ea4f
4 changed files with 12 additions and 13 deletions

View File

@ -55,9 +55,9 @@ export const settings = {
singleInstance: "singleInstance", singleInstance: "singleInstance",
skipArtists: "skipArtists", skipArtists: "skipArtists",
skippedArtists: "skippedArtists", skippedArtists: "skippedArtists",
staticWindowTitle: "staticWindowTitle",
theme: "theme", theme: "theme",
trayIcon: "trayIcon", trayIcon: "trayIcon",
staticWindowTitle: "staticWindowTitle",
updateFrequency: "updateFrequency", updateFrequency: "updateFrequency",
windowBounds: { windowBounds: {
root: "windowBounds", root: "windowBounds",

View File

@ -46,9 +46,9 @@ let adBlock: HTMLInputElement,
singleInstance: HTMLInputElement, singleInstance: HTMLInputElement,
skipArtists: HTMLInputElement, skipArtists: HTMLInputElement,
skippedArtists: HTMLInputElement, skippedArtists: HTMLInputElement,
staticWindowTitle: HTMLInputElement,
theme: HTMLSelectElement, theme: HTMLSelectElement,
trayIcon: HTMLInputElement, trayIcon: HTMLInputElement,
staticWindowTitle: HTMLInputElement,
updateFrequency: HTMLInputElement, updateFrequency: HTMLInputElement,
enableListenBrainz: HTMLInputElement, enableListenBrainz: HTMLInputElement,
ListenBrainzAPI: HTMLInputElement, ListenBrainzAPI: HTMLInputElement,
@ -141,10 +141,10 @@ function refreshSettings() {
port.value = settingsStore.get(settings.apiSettings.port); port.value = settingsStore.get(settings.apiSettings.port);
singleInstance.checked = settingsStore.get(settings.singleInstance); singleInstance.checked = settingsStore.get(settings.singleInstance);
skipArtists.checked = settingsStore.get(settings.skipArtists); skipArtists.checked = settingsStore.get(settings.skipArtists);
theme.value = settingsStore.get(settings.theme);
skippedArtists.value = settingsStore.get<string, string[]>(settings.skippedArtists).join("\n"); skippedArtists.value = settingsStore.get<string, string[]>(settings.skippedArtists).join("\n");
trayIcon.checked = settingsStore.get(settings.trayIcon);
staticWindowTitle.checked = settingsStore.get(settings.staticWindowTitle); staticWindowTitle.checked = settingsStore.get(settings.staticWindowTitle);
theme.value = settingsStore.get(settings.theme);
trayIcon.checked = settingsStore.get(settings.trayIcon);
updateFrequency.value = settingsStore.get(settings.updateFrequency); updateFrequency.value = settingsStore.get(settings.updateFrequency);
enableListenBrainz.checked = settingsStore.get(settings.ListenBrainz.enabled); enableListenBrainz.checked = settingsStore.get(settings.ListenBrainz.enabled);
ListenBrainzAPI.value = settingsStore.get(settings.ListenBrainz.api); ListenBrainzAPI.value = settingsStore.get(settings.ListenBrainz.api);
@ -261,9 +261,9 @@ window.addEventListener("DOMContentLoaded", () => {
port = get("port"); port = get("port");
theme = get<HTMLSelectElement>("themesList"); theme = get<HTMLSelectElement>("themesList");
trayIcon = get("trayIcon"); trayIcon = get("trayIcon");
staticWindowTitle = get("staticWindowTitle");
skipArtists = get("skipArtists"); skipArtists = get("skipArtists");
skippedArtists = get("skippedArtists"); skippedArtists = get("skippedArtists");
staticWindowTitle = get("staticWindowTitle");
singleInstance = get("singleInstance"); singleInstance = get("singleInstance");
updateFrequency = get("updateFrequency"); updateFrequency = get("updateFrequency");
enableListenBrainz = get("enableListenBrainz"); enableListenBrainz = get("enableListenBrainz");
@ -298,10 +298,10 @@ window.addEventListener("DOMContentLoaded", () => {
addInputListener(port, settings.apiSettings.port); addInputListener(port, settings.apiSettings.port);
addInputListener(skipArtists, settings.skipArtists); addInputListener(skipArtists, settings.skipArtists);
addTextAreaListener(skippedArtists, settings.skippedArtists); addTextAreaListener(skippedArtists, settings.skippedArtists);
addInputListener(staticWindowTitle, settings.staticWindowTitle);
addInputListener(singleInstance, settings.singleInstance); addInputListener(singleInstance, settings.singleInstance);
addSelectListener(theme, settings.theme); addSelectListener(theme, settings.theme);
addInputListener(trayIcon, settings.trayIcon); addInputListener(trayIcon, settings.trayIcon);
addInputListener(staticWindowTitle, settings.staticWindowTitle);
addInputListener(updateFrequency, settings.updateFrequency); addInputListener(updateFrequency, settings.updateFrequency);
addInputListener( addInputListener(
enableListenBrainz, enableListenBrainz,

View File

@ -595,8 +595,7 @@ setInterval(function () {
}; };
// update title, url and play info with new info // update title, url and play info with new info
if(settingsStore.get(settings.staticWindowTitle)) setTitle(staticTitle) settingsStore.get(settings.staticWindowTitle) ? setTitle(staticTitle) : setTitle(songDashArtistTitle);
else setTitle(songDashArtistTitle);
getTrackURL(); getTrackURL();
currentSong = songDashArtistTitle; currentSong = songDashArtistTitle;
currentPlayStatus = currentStatus; currentPlayStatus = currentStatus;

View File

@ -69,9 +69,9 @@ export const settingsStore = new Store({
singleInstance: true, singleInstance: true,
skipArtists: false, skipArtists: false,
skippedArtists: [""], skippedArtists: [""],
staticWindowTitle: false,
theme: "none", theme: "none",
trayIcon: true, trayIcon: true,
staticWindowTitle: false,
updateFrequency: 500, updateFrequency: 500,
windowBounds: { width: 800, height: 600 }, windowBounds: { width: 800, height: 600 },
}, },