fix: clock hot reload

This commit is contained in:
David Ralph
2021-08-18 14:48:52 +01:00
parent fb15a1037b
commit a91d5843b9
5 changed files with 12 additions and 11 deletions

View File

@@ -13,8 +13,8 @@ export function nth(d) {
default:
return d + 'th';
}
}
};
export function convertTimezone(date, tz) {
return new Date((typeof date === 'string' ? new Date(date) : date).toLocaleString('en-US', { timeZone: tz }));
}
};

View File

@@ -4,7 +4,7 @@ import EventBus from './eventbus';
export function urlParser(input) {
const urlPattern = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_+.~#?&//=]*)/;
return input.replace(urlPattern, '<a href="$&" target="_blank">$&</a>');
}
};
export function uninstall(type, name) {
switch (type) {
@@ -40,7 +40,7 @@ export function uninstall(type, name) {
}
}
localStorage.setItem('installed', JSON.stringify(installed));
}
};
export function install(type, input, sideload) {
switch (type) {
@@ -96,4 +96,4 @@ export function install(type, input, sideload) {
}
localStorage.setItem('installed', JSON.stringify(installed));
}
};

View File

@@ -25,7 +25,7 @@ export function setDefaultSettings(reset) {
// Finally we set this to true so it doesn't run the function on every load
localStorage.setItem('firstRun', true);
}
};
export function loadSettings(hotreload) {
document.getElementById('widgets').style.zoom = localStorage.getItem('widgetzoom') + '%';
@@ -121,7 +121,7 @@ export function loadSettings(hotreload) {
██ Feedback: hello@muetab.com ██
█████████████████████████████████████████████████████████████
`);
}
};
// in a nutshell, this function saves all of the current settings, resets them, sets the defaults and then overrides
// the new settings with the old saved messages where they exist
@@ -141,4 +141,4 @@ export function moveSettings() {
Object.keys(settings).forEach((key) => {
localStorage.setItem(key, settings[key]);
});
}
};

View File

@@ -24,7 +24,7 @@ export function exportSettings() {
});
saveFile(settings, 'mue-settings.json');
window.stats.postEvent('tab', 'Settings exported');
}
};
export function importSettings(e) {
const content = JSON.parse(e.target.result);
@@ -35,4 +35,4 @@ export function importSettings(e) {
toast(window.language.toasts.imported);
window.stats.postEvent('tab', 'Settings imported');
}
};