fix: 移除会话ID格式化函数,简化连接状态更新逻辑
This commit is contained in:
1 parent
8cb3c4053c
commit
a01b9ab5e7
1 file changed
+1
-7
@@ -1082,11 +1082,6 @@ function updateConnectionStatus(message: LocalizedMessage): void {
|
||||
}
|
||||
}
|
||||
|
||||
function formatSessionId(id: string): string {
|
||||
if (!id) return '';
|
||||
return id.length > 8 ? `${id.slice(0, 8)}…` : id;
|
||||
}
|
||||
|
||||
function setState(state: ConnectionState, label?: string): void {
|
||||
connectionState = state;
|
||||
const stateLabel = label ?? ({
|
||||
@@ -1100,11 +1095,10 @@ function setState(state: ConnectionState, label?: string): void {
|
||||
ui.liveOrbLabel.textContent = stateLabel;
|
||||
ui.liveOrb.title = stateLabel;
|
||||
const control = resolveConnectionControl(state, historyPasswordLoading);
|
||||
const sessionPrefix = formatSessionId(currentSessionId);
|
||||
const controlLabel = control.action === 'cancel'
|
||||
? bilingual('取消连接', 'Cancel connection')
|
||||
: control.action === 'disconnect'
|
||||
? (sessionPrefix ? `${sessionPrefix} ${bilingual('断开', 'Disconnect')}` : bilingual('断开', 'Disconnect'))
|
||||
? bilingual('断开', 'Disconnect')
|
||||
: control.action === 'disconnecting'
|
||||
? bilingual('断开中...', 'Disconnecting...')
|
||||
: bilingual('连接', 'Connect');
|
||||
|
||||
Reference in new issue
Block a user