added email verification
This commit is contained in:
@@ -9,7 +9,7 @@ document.addEventListener('DOMContentLoaded', async function () {
|
||||
selectFileButton.addEventListener('click', async function (event) {
|
||||
event.preventDefault();
|
||||
try {
|
||||
pathToFile = await window.electronAPI.selectFile();
|
||||
pathToFile = await window.uiAPI.selectFile();
|
||||
updateFileName();
|
||||
} catch (error) {
|
||||
console.error('Error opening file dialog:', error);
|
||||
@@ -20,11 +20,11 @@ document.addEventListener('DOMContentLoaded', async function () {
|
||||
|
||||
// Check if a file was chosen
|
||||
if (!pathToFile.trim()) {
|
||||
await window.electronAPI.showAlert('File not chosen!');
|
||||
await window.uiAPI.showAlert('File not chosen!');
|
||||
return;
|
||||
}
|
||||
|
||||
const user_info = await window.electronAPI.readUserConfig('user_info');
|
||||
const user_info = await window.databaseAPI.getUserInfo();
|
||||
if (!user_info) {
|
||||
return;
|
||||
}
|
||||
@@ -36,7 +36,7 @@ document.addEventListener('DOMContentLoaded', async function () {
|
||||
.map(checkbox => checkbox.value); // Get IP of the selected users
|
||||
|
||||
if (!selectedUserIps.length) {
|
||||
await window.electronAPI.showAlert('No user selected!');
|
||||
await window.uiAPI.showAlert('No user selected!');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -48,8 +48,8 @@ document.addEventListener('DOMContentLoaded', async function () {
|
||||
path: pathToFile, // File path
|
||||
userName: user_info.name // Sender's username from userConfig
|
||||
};
|
||||
await window.electronAPI.addTaskToSendFileQueue(task);
|
||||
await window.electronAPI.showAlert('File sent to the queue.');
|
||||
await window.databaseAPI.addTaskToSendFileQueue(task);
|
||||
await window.uiAPI.showAlert('File sent to the queue.');
|
||||
console.log(`Task added to send file to IP ${selectedUserIp}`);
|
||||
} catch (error) {
|
||||
console.error(`Error processing IP ${selectedUserIp}:`, error);
|
||||
@@ -85,18 +85,12 @@ async function fetchUsersAndCreateCheckboxes() {
|
||||
.map(checkbox => checkbox.value)
|
||||
);
|
||||
|
||||
const usersInfoId = await window.electronAPI.readApplicationInfo('active_users_info');
|
||||
if (!usersInfoId) {
|
||||
await window.electronAPI.showAlert('Internal error.');
|
||||
return;
|
||||
}
|
||||
|
||||
const usersInfo = await window.electronAPI.readMemoryEntry(usersInfoId);
|
||||
const usersInfo = await window.databaseAPI.getActiveUsers();
|
||||
if (!usersInfo || usersInfo.length === 0) {
|
||||
await window.electronAPI.showAlert('No active users found.');
|
||||
await window.uiAPI.showAlert('No active users found.');
|
||||
clearInterval(fetchUsersInterval);
|
||||
fetchUsersInterval = null;
|
||||
await window.electronAPI.changeContent('main_menu');
|
||||
await window.uiAPI.changeContent('main_menu');
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -115,7 +109,7 @@ async function fetchUsersAndCreateCheckboxes() {
|
||||
}
|
||||
|
||||
const label = document.createElement('label');
|
||||
label.innerHTML = `${user.user_info.name}`; // Display user's name
|
||||
label.innerHTML = `${user.user_info.name}`;
|
||||
label.insertBefore(checkbox, label.firstChild);
|
||||
|
||||
usersDiv.appendChild(label);
|
||||
|
||||
Reference in New Issue
Block a user