mirror of
https://github.com/mue/mue.git
synced 2026-06-12 03:28:46 +02:00
codacy
This commit is contained in:
@@ -2,7 +2,7 @@ import { toast } from 'react-toastify';
|
||||
|
||||
export default class MarketplaceFunctions {
|
||||
static urlParser (input) { // based on https://stackoverflow.com/questions/37684/how-to-replace-plain-urls-with-links
|
||||
let urlPattern = /https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()!@:%_+.~#?&//=]*)/;
|
||||
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>');
|
||||
}
|
||||
|
||||
@@ -17,11 +17,11 @@ export default class MarketplaceFunctions {
|
||||
}
|
||||
}
|
||||
localStorage.setItem('installed', JSON.stringify(installed));
|
||||
}
|
||||
};
|
||||
|
||||
switch (type) {
|
||||
case 'settings':
|
||||
let oldSettings = JSON.parse(localStorage.getItem('backup_settings'));
|
||||
const oldSettings = JSON.parse(localStorage.getItem('backup_settings'));
|
||||
localStorage.clear();
|
||||
oldSettings.forEach(item => localStorage.setItem(item.name, item.value));
|
||||
uninstallStuff();
|
||||
|
||||
@@ -26,7 +26,7 @@ export default class SettingsFunctions {
|
||||
}
|
||||
|
||||
static setItem(key, value) {
|
||||
let old = localStorage.getItem(key);
|
||||
const old = localStorage.getItem(key);
|
||||
let val = true;
|
||||
|
||||
if (old !== null && !value) {
|
||||
|
||||
Reference in New Issue
Block a user