mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-11 02:34:29 +05:00
refactor: optimizations & fixes
This commit is contained in:
@@ -306,22 +306,6 @@ const setupRestoreBackupForm = (formSelector) => {
|
||||
try {
|
||||
const data = JSON.parse(event.target.result);
|
||||
console.log("Backup: ", data);
|
||||
|
||||
if (data.network != undefined) {
|
||||
let response = await fetch(url, {
|
||||
method: 'POST',
|
||||
cache: 'no-cache',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({"network": data.network})
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
onFailed();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (data.settings != undefined) {
|
||||
let response = await fetch(url, {
|
||||
@@ -362,6 +346,22 @@ const setupRestoreBackupForm = (formSelector) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (data.network != undefined) {
|
||||
let response = await fetch(url, {
|
||||
method: 'POST',
|
||||
cache: 'no-cache',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: JSON.stringify({"network": data.network})
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
onFailed();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
onSuccess();
|
||||
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user