Fixed overview departments .js
This commit is contained in:
@@ -10,11 +10,6 @@ document.addEventListener('DOMContentLoaded', async () => {
|
|||||||
const closeCreateModalButton = document.getElementById('closeCreateModal');
|
const closeCreateModalButton = document.getElementById('closeCreateModal');
|
||||||
const confirmCreateButton = document.getElementById('confirmCreateButton');
|
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 () => {
|
backButton.addEventListener('click', async () => {
|
||||||
await window.networkAPI.closeUcSocket();
|
await window.networkAPI.closeUcSocket();
|
||||||
fadeOut('main_menu');
|
fadeOut('main_menu');
|
||||||
@@ -48,6 +43,11 @@ async function fetchDepartments() {
|
|||||||
const departmentsContainer = document.getElementById('departments-container');
|
const departmentsContainer = document.getElementById('departments-container');
|
||||||
departmentsContainer.innerHTML = ''; // Clear any existing data
|
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
|
// Retrieve the operation codes via IPC
|
||||||
const operationCodes = await window.networkAPI.getOperationsCodes();
|
const operationCodes = await window.networkAPI.getOperationsCodes();
|
||||||
if (!operationCodes) {
|
if (!operationCodes) {
|
||||||
|
|||||||
@@ -122,12 +122,13 @@ export class WindowManager {
|
|||||||
title: 'Announcement',
|
title: 'Announcement',
|
||||||
webPreferences: {
|
webPreferences: {
|
||||||
preload: path.join(__dirname, '..', 'main', 'preload.js'),
|
preload: path.join(__dirname, '..', 'main', 'preload.js'),
|
||||||
contextIsolation: true,
|
|
||||||
nodeIntegration: false,
|
nodeIntegration: false,
|
||||||
|
contextIsolation: true,
|
||||||
|
sandbox: false,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
this.announcementWindow.removeMenu()
|
//this.announcementWindow.removeMenu()
|
||||||
const announcementPath = path.join(this.pathToPagesDir, 'announcement.html')
|
const announcementPath = path.join(this.pathToPagesDir, 'announcement.html')
|
||||||
await this.announcementWindow.loadFile(announcementPath)
|
await this.announcementWindow.loadFile(announcementPath)
|
||||||
|
|
||||||
|
|||||||
@@ -201,7 +201,11 @@ function registerIPCHandlers() {
|
|||||||
if (!db) throw new Error('Database is not initialized.')
|
if (!db) throw new Error('Database is not initialized.')
|
||||||
const data = await db.read()
|
const data = await db.read()
|
||||||
const announcement = data.network.announcement
|
const announcement = data.network.announcement
|
||||||
|
|
||||||
|
await db.update((data) => {
|
||||||
data.network.announcement = ''
|
data.network.announcement = ''
|
||||||
|
return data
|
||||||
|
})
|
||||||
|
|
||||||
return announcement
|
return announcement
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user