File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -516,6 +516,9 @@ export function activate(context: vscode.ExtensionContext) {
516516 showCollapseAll : true
517517 } ) ;
518518
519+ // 记录已经提醒过的相同Session ID,避免重复提醒
520+ let lastNotifiedSameSessionId : string | null = null ;
521+
519522 // 剪贴板检测功能
520523 async function checkClipboardForSession ( ) {
521524 try {
@@ -540,11 +543,17 @@ export function activate(context: vscode.ExtensionContext) {
540543 vscode . window . showInformationMessage ( t ( 'messages.sessionIdAutoUpdated' ) ) ;
541544 provider . refresh ( ) ;
542545 }
546+ // 重置已提醒的Session ID,因为检测到了不同的Session ID
547+ lastNotifiedSameSessionId = null ;
543548 } else {
544- // 如果Session ID相同,提示用户识别到相同的Session ID
545- vscode . window . showInformationMessage (
546- t ( 'messages.sameSessionIdDetected' , { sessionId : sessionId . substring ( 0 , 20 ) } )
547- ) ;
549+ // 如果Session ID相同,且之前没有提醒过这个Session ID,则提示用户
550+ if ( lastNotifiedSameSessionId !== sessionId ) {
551+ vscode . window . showInformationMessage (
552+ t ( 'messages.sameSessionIdDetected' , { sessionId : sessionId . substring ( 0 , 20 ) } )
553+ ) ;
554+ // 记录已经提醒过的Session ID
555+ lastNotifiedSameSessionId = sessionId ;
556+ }
548557 }
549558 }
550559 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments