Updated Announcement
This commit is contained in:
+1
-1
@@ -1,3 +1,3 @@
|
||||
UDP_PORT=41234
|
||||
TCP_PORT=41233
|
||||
IS_CLIENT=true
|
||||
IS_CLIENT=false
|
||||
@@ -87,6 +87,8 @@ async function fetchDepartments() {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(filteredDepartments)
|
||||
|
||||
filteredDepartments.forEach(department => {
|
||||
const departmentDiv = document.createElement('div');
|
||||
departmentDiv.classList.add('department-card');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Load announcement content from the application info when the page loads
|
||||
async function loadAnnouncement() {
|
||||
try {
|
||||
const announcementText = await window.electronAPI.readAnnouncement();
|
||||
const announcementText = await window.uiAPI.readAnnouncement();
|
||||
const announcementContent = document.getElementById('announcement-content');
|
||||
if (announcementContent && announcementText) {
|
||||
announcementContent.innerHTML = formatTextForHtml(announcementText);
|
||||
@@ -22,5 +22,5 @@ function formatTextForHtml(text) {
|
||||
|
||||
// Close the window when the close button is clicked
|
||||
function closeWindow() {
|
||||
window.electronAPI.closeAnnouncementWindow();
|
||||
window.uiAPI.closeAnnouncementWindow();
|
||||
}
|
||||
|
||||
@@ -45,9 +45,11 @@ export class AnnouncementSender {
|
||||
type: 'showAlert',
|
||||
message: 'Announcement sent to all active users successfully.',
|
||||
})
|
||||
process.send?.({ type: 'changeContent', page: 'announcement' })
|
||||
} catch (error: any) {
|
||||
console.error('Error in AnnouncementWorker:', error)
|
||||
process.send?.({ type: 'shotAlert', message: `A problem occurred: ${error.message}` })
|
||||
process.send?.({ type: 'changeContent', page: 'announcement' })
|
||||
}
|
||||
|
||||
console.log('AnnouncementWorker finished.')
|
||||
|
||||
@@ -102,7 +102,7 @@ app.whenReady().then(async () => {
|
||||
},
|
||||
})
|
||||
|
||||
mainWindow.removeMenu()
|
||||
//mainWindow.removeMenu()
|
||||
|
||||
await ensureDirectoryExists(pathToClientsBackups)
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ export class UserToUserOperations implements OperationPlugin {
|
||||
await database.update((data: any) => {
|
||||
if (!parsedMessage.metaInfo) return data
|
||||
|
||||
data.app_config.announcement = parsedMessage.metaInfo.message
|
||||
data.network.announcement = parsedMessage.metaInfo.message
|
||||
return data
|
||||
})
|
||||
return { operationCode: operationCodes.OK, metaInfo: { message: 'Announcement saved.' } }
|
||||
|
||||
Reference in New Issue
Block a user