File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1877,6 +1877,7 @@ export const useChatState = Z.createZustand<State>((set, get) => {
18771877 }
18781878 } else {
18791879 // logger.info('Got push state with some exploding modes')
1880+ const activeConvs = new Set < string > ( )
18801881 explodingItems . forEach ( i => {
18811882 try {
18821883 const { category, body} = i . item
@@ -1888,11 +1889,18 @@ export const useChatState = Z.createZustand<State>((set, get) => {
18881889 }
18891890 const _conversationIDKey = category . substring ( Common . explodingModeGregorKeyPrefix . length )
18901891 const conversationIDKey = T . Chat . stringToConversationIDKey ( _conversationIDKey )
1892+ activeConvs . add ( conversationIDKey )
18911893 storeRegistry . getConvoState ( conversationIDKey ) . dispatch . setExplodingMode ( seconds , true )
18921894 } catch ( e ) {
18931895 logger . info ( 'Error parsing exploding' + e )
18941896 }
18951897 } )
1898+ // Clear any convos whose exploding mode was removed from gregor state
1899+ for ( const [ convKey , s ] of chatStores ) {
1900+ if ( ! activeConvs . has ( convKey ) && s . getState ( ) . explodingMode !== 0 ) {
1901+ s . getState ( ) . dispatch . setExplodingMode ( 0 , true )
1902+ }
1903+ }
18961904 }
18971905
18981906 set ( s => {
You can’t perform that action at this time.
0 commit comments