소스 검색

[frontent] fixed incorrect namespaceId that caused assistpanel to switch to default DB

Björn Alm 2 년 전
부모
커밋
3df0b6da66
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      desktop/core/src/desktop/js/apps/tableBrowser/metastoreSource.js

+ 3 - 3
desktop/core/src/desktop/js/apps/tableBrowser/metastoreSource.js

@@ -65,9 +65,9 @@ class MetastoreSource {
 
 
     huePubSub.subscribe(ASSIST_DB_PANEL_IS_READY_EVENT, () => {
     huePubSub.subscribe(ASSIST_DB_PANEL_IS_READY_EVENT, () => {
       this.lastLoadNamespacesDeferred.done(() => {
       this.lastLoadNamespacesDeferred.done(() => {
-        let lastSelectedDb = getFromLocalStorage(
-          'assist_' + this.type + '_' + this.namespace.id + '.lastSelectedDb'
-        );
+        const namespaceId = _this.namespace().namespace.id;
+        const localStorageKey = `assist_${this.type}_${namespaceId}.lastSelectedDb`;
+        let lastSelectedDb = getFromLocalStorage(localStorageKey);
         if (!lastSelectedDb && lastSelectedDb !== '') {
         if (!lastSelectedDb && lastSelectedDb !== '') {
           lastSelectedDb = 'default';
           lastSelectedDb = 'default';
         }
         }