feat: implement tray functionality with status updates and localization support
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { BrowserWindow } from 'electron';
|
||||
import { windowManager } from '@electron/service/window-service';
|
||||
import logManager from '@electron/service/logger';
|
||||
import { updateTrayStatus } from '@electron/main/tray';
|
||||
import type { GatewayEvent, RuntimeRefreshTopic } from './types';
|
||||
import * as chatHandlers from './handlers/chat';
|
||||
import * as providerHandlers from './handlers/provider';
|
||||
@@ -20,15 +21,15 @@ class GatewayManager {
|
||||
|
||||
private setStatus(status: 'connected' | 'disconnected' | 'reconnecting'): void {
|
||||
this.status = status;
|
||||
updateTrayStatus(status);
|
||||
this.broadcast({ type: 'gateway:status', status });
|
||||
}
|
||||
|
||||
async init(): Promise<void> {
|
||||
if (this.initialized) return;
|
||||
this.initialized = true;
|
||||
this.status = 'connected';
|
||||
logManager.info('GatewayManager initialized');
|
||||
this.broadcast({ type: 'gateway:status', status: 'connected' });
|
||||
this.setStatus('connected');
|
||||
}
|
||||
|
||||
async start(): Promise<void> {
|
||||
|
||||
Reference in New Issue
Block a user