fix: console error and codacy

This commit is contained in:
David Ralph
2021-08-27 18:27:11 +01:00
parent feb7e1d93c
commit abe70617d8
19 changed files with 25 additions and 23 deletions

View File

@@ -25,7 +25,7 @@ export function offlineBackground() {
localStorage.setItem('currentBackground', JSON.stringify(object));
return object;
};
}
export function gradientStyleBuilder({ type, angle, gradient }) {
// Note: Append the gradient for additional browser support.
@@ -35,5 +35,5 @@ export function gradientStyleBuilder({ type, angle, gradient }) {
return {
type: 'colour',
style: `background:${gradient[0]?.colour};${grad}`
}
};
};

View File

@@ -17,4 +17,4 @@ export function nth(d) {
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) {

View File

@@ -144,7 +144,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

View File

@@ -25,7 +25,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);