maobaolong commented on code in PR #2238:
URL: 
https://github.com/apache/incubator-uniffle/pull/2238#discussion_r1830333998


##########
dashboard/src/main/webapp/src/store/useCurrentServerStore.js:
##########
@@ -16,13 +16,18 @@
  */
 
 import { defineStore } from 'pinia'
-import { ref } from 'vue'
+import { ref, watch } from 'vue'
 
 /**
  * Create a global shared repository that allows you to share state across 
components/pages.
  * @type {StoreDefinition<"overall", 
_ExtractStateFromSetupStore<{currentServer: Ref<UnwrapRef<string>>}>, 
_ExtractGettersFromSetupStore<{currentServer: Ref<UnwrapRef<string>>}>, 
_ExtractActionsFromSetupStore<{currentServer: Ref<UnwrapRef<string>>}>>}
  */
 export const useCurrentServerStore = defineStore('overall', () => {
-  const currentServer = ref('')
-  return { currentServer }
-})
+    const currentServer = ref(sessionStorage.getItem('currentServer'))
+
+    watch(currentServer, (newVal) => {
+        sessionStorage.setItem('currentServer', newVal)
+    })
+
+    return { currentServer }
+})

Review Comment:
   Please add a new line here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to