Fixed overview departments .js
This commit is contained in:
@@ -10,11 +10,6 @@ document.addEventListener('DOMContentLoaded', async () => {
|
||||
const closeCreateModalButton = document.getElementById('closeCreateModal');
|
||||
const confirmCreateButton = document.getElementById('confirmCreateButton');
|
||||
|
||||
if (!await window.networkAPI.openUcSocket()) {
|
||||
await window.uiAPI.showAlert('Internal error of the application. Unable to open socket.');
|
||||
return;
|
||||
}
|
||||
|
||||
backButton.addEventListener('click', async () => {
|
||||
await window.networkAPI.closeUcSocket();
|
||||
fadeOut('main_menu');
|
||||
@@ -48,6 +43,11 @@ async function fetchDepartments() {
|
||||
const departmentsContainer = document.getElementById('departments-container');
|
||||
departmentsContainer.innerHTML = ''; // Clear any existing data
|
||||
|
||||
if (!await window.networkAPI.openUcSocket()) {
|
||||
await window.uiAPI.showAlert('Internal error of the application. Unable to open socket.');
|
||||
return;
|
||||
}
|
||||
|
||||
// Retrieve the operation codes via IPC
|
||||
const operationCodes = await window.networkAPI.getOperationsCodes();
|
||||
if (!operationCodes) {
|
||||
|
||||
Reference in New Issue
Block a user