mirror of
https://codeberg.org/nobody/LocalCDN.git
synced 2025-02-09 00:18:42 +01:00
Improved: Backup and restore validation (#174)
This commit is contained in:
parent
d045e9d9cc
commit
87120aceba
@ -148,6 +148,11 @@ storageManager._validation = function (content) {
|
|||||||
delete content['hideReleaseNotes'];
|
delete content['hideReleaseNotes'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Convert type of updateNotification
|
||||||
|
if (typeof content.updateNotification === 'string') {
|
||||||
|
content.updateNotification = parseInt(content.updateNotification);
|
||||||
|
}
|
||||||
|
|
||||||
for (const [key, value] of Object.entries(SettingDefaults)) {
|
for (const [key, value] of Object.entries(SettingDefaults)) {
|
||||||
// If type the same as default settings
|
// If type the same as default settings
|
||||||
if (typeof value === typeof content[key]) {
|
if (typeof value === typeof content[key]) {
|
||||||
@ -164,7 +169,7 @@ storageManager._validation = function (content) {
|
|||||||
// Set default if not existing in file
|
// Set default if not existing in file
|
||||||
imported[key] = value;
|
imported[key] = value;
|
||||||
} else {
|
} else {
|
||||||
alert(chrome.i18n.getMessage('dialogImportFailed'));
|
alert(chrome.i18n.getMessage('dialogImportFailed') + '\n\n' + key + ': ' + content[key]);
|
||||||
throw 'Invalid file!';
|
throw 'Invalid file!';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li>Fixed: HTML filter (<a href="https://codeberg.org/nobody/LocalCDN/issues/192">#192</a>)</li>
|
<li>Fixed: HTML filter (<a href="https://codeberg.org/nobody/LocalCDN/issues/192">#192</a>)</li>
|
||||||
<li>Updated: bootstrap-table v1.18.0 -> v1.18.1 (<a href="https://codeberg.org/nobody/LocalCDN/issues/193">#193</a>)</li>
|
<li>Updated: bootstrap-table v1.18.0 -> v1.18.1 (<a href="https://codeberg.org/nobody/LocalCDN/issues/193">#193</a>)</li>
|
||||||
|
<li>Improved: Backup and restore validation (<a href="https://codeberg.org/nobody/LocalCDN/issues/174">#174</a>)</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div id="generator-section">
|
<div id="generator-section">
|
||||||
<div class="topic-label">
|
<div class="topic-label">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user