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) {
|
||||
|
||||
@@ -122,12 +122,13 @@ export class WindowManager {
|
||||
title: 'Announcement',
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, '..', 'main', 'preload.js'),
|
||||
contextIsolation: true,
|
||||
nodeIntegration: false,
|
||||
contextIsolation: true,
|
||||
sandbox: false,
|
||||
},
|
||||
})
|
||||
|
||||
this.announcementWindow.removeMenu()
|
||||
//this.announcementWindow.removeMenu()
|
||||
const announcementPath = path.join(this.pathToPagesDir, 'announcement.html')
|
||||
await this.announcementWindow.loadFile(announcementPath)
|
||||
|
||||
|
||||
@@ -201,7 +201,11 @@ function registerIPCHandlers() {
|
||||
if (!db) throw new Error('Database is not initialized.')
|
||||
const data = await db.read()
|
||||
const announcement = data.network.announcement
|
||||
data.network.announcement = ''
|
||||
|
||||
await db.update((data) => {
|
||||
data.network.announcement = ''
|
||||
return data
|
||||
})
|
||||
|
||||
return announcement
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user