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",
skipArtists: "skipArtists",
skippedArtists: "skippedArtists",
staticWindowTitle: "staticWindowTitle",
theme: "theme",
trayIcon: "trayIcon",
staticWindowTitle: "staticWindowTitle",
updateFrequency: "updateFrequency",
windowBounds: {
root: "windowBounds",

View File

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

View File

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

View File

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