File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 148148
149149 const TOKEN_STORAGE_KEY = 'token' ;
150150 const SHELL_LOCALE_STORAGE_KEY = 'astrbot-locale' ;
151+ const CHAT_TRANSPORT_MODE_STORAGE_KEY = 'chat.transportMode' ;
152+ const CHAT_TRANSPORT_MODE_WEBSOCKET = 'websocket' ;
151153 const STORAGE_SYNC_PATCHED_FLAG = '__astrbotDesktopStorageSyncPatched' ;
152154 const LEGACY_TOKEN_SYNC_PATCHED_FLAG = '__astrbotDesktopTokenSyncPatched' ;
153155
697699 } catch { }
698700 } ;
699701
702+ const ensureDefaultChatTransportMode = ( ) => {
703+ try {
704+ const storage = window . localStorage ;
705+ if ( ! storage ) return ;
706+ if ( storage . getItem ( CHAT_TRANSPORT_MODE_STORAGE_KEY ) ) return ;
707+ storage . setItem (
708+ CHAT_TRANSPORT_MODE_STORAGE_KEY ,
709+ CHAT_TRANSPORT_MODE_WEBSOCKET ,
710+ ) ;
711+ } catch { }
712+ } ;
713+
700714 window . astrbotDesktop = {
701715 __tauriBridge : true ,
702716 isDesktop : true ,
740754 installNavigationBridges ( ) ;
741755 void listenToTrayRestartBackendEvent ( ) ;
742756 patchLocalStorageBridgeSync ( ) ;
757+ ensureDefaultChatTransportMode ( ) ;
743758 void syncAuthToken ( ) ;
744759 void syncShellLocale ( ) ;
745760} ) ( ) ;
You can’t perform that action at this time.
0 commit comments