File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,14 @@ export const processCliAction = (message: PostMessage) => {
10
10
return
11
11
}
12
12
13
+ const prevDatabaseId = useDatabasesStore . getState ( ) . connectedDatabase ?. id
13
14
const database = message ?. data ?. database
15
+
16
+ if ( prevDatabaseId === database ?. id ) {
17
+ return
18
+ }
14
19
window . ri . database = database
20
+ addCli ( )
15
21
16
22
useDatabasesStore . getState ( ) . setConnectedDatabase ( database )
17
- addCli ( database )
18
23
}
Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ export const CliBodyWrapper = () => {
63
63
64
64
useEffect ( ( ) => {
65
65
! cliClientUuid && host && createCliClientAction ( database ! )
66
+ resetCommand ( )
66
67
return ( ) => {
67
68
removeCliClient ( )
68
69
}
Original file line number Diff line number Diff line change @@ -185,10 +185,10 @@ function updateCliHistory() {
185
185
}
186
186
187
187
// async thunk function
188
- export function addCli ( database : Database ) {
188
+ export function addCli ( ) {
189
189
updateCliHistory ( )
190
190
useCliOutputStore . getState ( ) . resetOutput ( )
191
- createCliClientAction ( database )
191
+ useCliSettingsStore . getState ( ) . resetCliClientUuid ( )
192
192
}
193
193
194
194
// async thunk function
You can’t perform that action at this time.
0 commit comments