feat(logs): refresh on reconnect and section activation

This commit is contained in:
hkfires
2025-11-21 10:59:21 +08:00
parent 323485445d
commit 608be95020
4 changed files with 40 additions and 11 deletions

View File

@@ -215,10 +215,14 @@ export const connectionModule = {
this.updateConnectionInfo();
if (this.events && typeof this.events.emit === 'function') {
this.events.emit('connection:status-changed', {
isConnected: this.isConnected,
apiBase: this.apiBase
});
const shouldEmit = this.lastConnectionStatusEmitted !== this.isConnected;
if (shouldEmit) {
this.events.emit('connection:status-changed', {
isConnected: this.isConnected,
apiBase: this.apiBase
});
this.lastConnectionStatusEmitted = this.isConnected;
}
}
},
@@ -325,9 +329,6 @@ export const connectionModule = {
// 从配置中提取并设置各个设置项现在传递keyStats
await this.updateSettingsFromConfig(config, keyStats);
// 认证文件需要单独加载,因为不在配置中
await this.loadAuthFiles(keyStats);
if (this.events && typeof this.events.emit === 'function') {
this.events.emit('data:config-loaded', {
config,