Remove process display functionality
**Motivations :** - Process display is not needed at this stage and clutters the interface - User feedback indicates it's ugly and unnecessary **Modifications :** - Removed displayExistingProcesses() function calls from handleMainPairing() - Removed displayExistingProcesses() function calls from initHomePage() - Deleted the entire displayExistingProcesses() function - Simplified interface to focus on core pairing functionality **Pages affectées :** - src/pages/home/home.ts
This commit is contained in:
parent
cbe49aff5c
commit
63f6ac828f
@ -153,10 +153,6 @@ export async function initHomePage(): Promise<void> {
|
||||
console.log('🔐 Auto-triggering WebAuthn authentication...');
|
||||
await handleMainPairing();
|
||||
|
||||
// Display existing processes even if authentication fails
|
||||
console.log('📊 Displaying existing processes...');
|
||||
await displayExistingProcesses();
|
||||
|
||||
// Hide loading spinner after initialization
|
||||
console.log('🔧 Hiding loading spinner...');
|
||||
hideHomeLoadingSpinner();
|
||||
@ -585,9 +581,6 @@ async function handleMainPairing(): Promise<void> {
|
||||
// Now proceed with pairing process
|
||||
await prepareAndSendPairingTx();
|
||||
|
||||
// Display any existing processes in the status field
|
||||
await displayExistingProcesses();
|
||||
|
||||
} catch (error) {
|
||||
console.error('Pairing failed:', error);
|
||||
|
||||
@ -597,56 +590,6 @@ async function handleMainPairing(): Promise<void> {
|
||||
}
|
||||
}
|
||||
|
||||
// Display existing processes in the status field
|
||||
async function displayExistingProcesses(): Promise<void> {
|
||||
try {
|
||||
const service = await Services.getInstance();
|
||||
const processes = await service.getProcesses();
|
||||
|
||||
const container = getCorrectDOM('login-4nk-component') as HTMLElement;
|
||||
const mainStatus = container.querySelector('#main-status') as HTMLElement;
|
||||
|
||||
if (!mainStatus) {
|
||||
console.warn('Main status element not found');
|
||||
return;
|
||||
}
|
||||
|
||||
const processCount = Object.keys(processes).length;
|
||||
console.log(`📊 Found ${processCount} existing processes`);
|
||||
|
||||
if (processCount === 0) {
|
||||
if (mainStatus) {
|
||||
mainStatus.innerHTML = '<span style="color: var(--info-color)">📋 No existing processes found</span>';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Display all processes as simple text
|
||||
let allMessages = '';
|
||||
for (const [processId, process] of Object.entries(processes)) {
|
||||
const processInfo = {
|
||||
id: processId.substring(0, 8) + '...',
|
||||
states: process.states?.length || 0,
|
||||
members: Object.keys(process.members || {}).length,
|
||||
lastUpdate: process.last_update || 'Unknown'
|
||||
};
|
||||
|
||||
allMessages += `📋 Process ${processInfo.id} - States: ${processInfo.states}, Members: ${processInfo.members}, Updated: ${processInfo.lastUpdate}\n`;
|
||||
}
|
||||
|
||||
if (mainStatus) {
|
||||
mainStatus.innerHTML = `<div style="text-align: left; white-space: pre-line; font-family: monospace; font-size: 12px;">${allMessages}</div>`;
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('❌ Error displaying processes:', error);
|
||||
const container = getCorrectDOM('login-4nk-component') as HTMLElement;
|
||||
const mainStatus = container.querySelector('#main-status') as HTMLElement;
|
||||
if (mainStatus) {
|
||||
mainStatus.innerHTML = '<span style="color: var(--error-color)">❌ Error loading processes</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Account Actions
|
||||
export function setupAccountActions(): void {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user