File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
webviews/src/modules/config Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,7 @@ export async function activate(context: vscode.ExtensionContext) {
84
84
viewId : ViewId . AddKey ,
85
85
handleMessage : ( message ) => handleMessage ( message ) ,
86
86
message : args ,
87
- } )
87
+ } ) . postMessage ( { action : 'SetDatabase' , data : { database : args . data ?. database } } )
88
88
} ) ,
89
89
90
90
vscode . commands . registerCommand ( 'RedisForVSCode.addDatabase' , ( args ) => {
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { useShallow } from 'zustand/react/shallow'
3
3
4
4
import { useLocation } from 'react-router-dom'
5
5
import { isDifferentConsentsExists } from 'uiSrc/utils'
6
- import { fetchDatabases } from 'uiSrc/store'
6
+ import { fetchDatabases , useDatabasesStore } from 'uiSrc/store'
7
7
import { fetchAppInfo , useAppInfoStore } from 'uiSrc/store/hooks/use-app-info-store/useAppInfoStore'
8
8
import { vscodeApi } from 'uiSrc/services'
9
9
import { VscodeMessageAction } from 'uiSrc/constants'
@@ -23,6 +23,10 @@ export const Config = () => {
23
23
appInfo . setInitialStateAppInfo ( )
24
24
fetchDatabases ( )
25
25
26
+ if ( window . ri ?. database ) {
27
+ useDatabasesStore . getState ( ) . setConnectedDatabase ( window . ri . database )
28
+ }
29
+
26
30
if ( window . ri ?. appInfo ) {
27
31
appInfo . setAppInfo ( window . ri ?. appInfo )
28
32
return
You can’t perform that action at this time.
0 commit comments