modified some titles and fixed reset database I
This commit is contained in:
@@ -11,21 +11,27 @@ document.addEventListener('DOMContentLoaded', async function () {
|
||||
// Open a TCP socket to the stored IP
|
||||
if (!await window.networkAPI.openUcSocket()) {
|
||||
await window.uiAPI.showAlert('Internal error of the application. Unable to open socket.');
|
||||
await window.uiAPI.changeContent('main_menu');
|
||||
return;
|
||||
}
|
||||
|
||||
if (!await window.networkAPI.sendUcMessage(codeResetDatabase)) {
|
||||
await window.uiAPI.showAlert('Failed to send login request.');
|
||||
await window.uiAPI.changeContent('main_menu');
|
||||
await window.networkAPI.closeUcSocket();
|
||||
return;
|
||||
}
|
||||
|
||||
const response = await waitForResponse();
|
||||
if (response && response.operationCode !== codeOk) {
|
||||
await window.uiAPI.showAlert('Database reset failed.');
|
||||
await window.uiAPI.changeContent('main_menu');
|
||||
await window.networkAPI.closeUcSocket();
|
||||
return;
|
||||
}
|
||||
|
||||
await window.networkAPI.closeUcSocket();
|
||||
await new Promise(resolve => setTimeout(resolve, 2000));
|
||||
fadeOut('login');
|
||||
|
||||
await window.databaseAPI.resetInternalDatabase();
|
||||
await window.uiAPI.changeContent('welcome');
|
||||
});
|
||||
Reference in New Issue
Block a user