added email verification
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
// Load announcement content from the application info when the page loads
|
||||
async function loadAnnouncement() {
|
||||
try {
|
||||
const announcementText = await window.electronAPI.readApplicationInfo('announcement');
|
||||
const announcementText = await window.electronAPI.readAnnouncement();
|
||||
const announcementContent = document.getElementById('announcement-content');
|
||||
if (announcementContent && announcementText) {
|
||||
|
||||
console.log('Announcement:', announcementText);
|
||||
announcementContent.innerHTML = formatTextForHtml(announcementText);
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -15,14 +13,8 @@ async function loadAnnouncement() {
|
||||
}
|
||||
|
||||
function formatTextForHtml(text) {
|
||||
// Replace newlines with <br> tags
|
||||
let formattedText = text.replace(/\n/g, '<br>');
|
||||
|
||||
// Replace tabs with a few non-breaking spaces for indentation
|
||||
formattedText = formattedText.replace(/\t/g, ' ');
|
||||
|
||||
// Replace other special characters as needed
|
||||
// Example: Handle double spaces by converting to
|
||||
formattedText = formattedText.replace(/ /g, ' ');
|
||||
|
||||
return formattedText;
|
||||
@@ -30,6 +22,5 @@ function formatTextForHtml(text) {
|
||||
|
||||
// Close the window when the close button is clicked
|
||||
function closeWindow() {
|
||||
window.electronAPI.writeApplicationInfo('announcement', '');
|
||||
window.electronAPI.closeAnnouncementWindow();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user