File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -581,7 +581,7 @@ function removeInstance(id: string) {
581581 clearCacheForInstance ( id )
582582 messageStoreBus . unregisterInstance ( id )
583583 clearInstanceDraftPrompts ( id )
584- clearHistoryCache ( id )
584+ clearHistoryCache ( id , instance ?. folder )
585585 syncHasInstancesFlag ( )
586586}
587587
Original file line number Diff line number Diff line change @@ -9,9 +9,12 @@ const MAX_HISTORY = 100
99const historyCache = new Map < string , string [ ] > ( )
1010const historyLoadCache = new Map < string , Promise < string [ ] > > ( )
1111
12- export function clearHistoryCache ( instanceId : string ) : void {
13- historyCache . delete ( instanceId )
14- historyLoadCache . delete ( instanceId )
12+ export function clearHistoryCache ( ...keys : Array < string | null | undefined > ) : void {
13+ for ( const key of keys ) {
14+ if ( ! key ) continue
15+ historyCache . delete ( key )
16+ historyLoadCache . delete ( key )
17+ }
1518}
1619
1720export async function addToHistory ( instanceId : string , text : string ) : Promise < void > {
You can’t perform that action at this time.
0 commit comments