Skip to content

Commit

Permalink
fix selectors (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fine0830 committed Sep 5, 2024
1 parent d10f4ca commit 1945f23
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/views/dashboard/panel/Tool.vue
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ limitations under the License. -->
instanceId: selectorStore.currentPod.id,
});
if (setPod) {
const process = params.processId || selectorStore.processes[0].id;
const process = selectorStore.currentProcess?.id || params.processId || selectorStore.processes[0].id;
const currentProcess = selectorStore.processes.find((d: { id: string }) => d.id === process);
if (currentProcess) {
selectorStore.setCurrentProcess(currentProcess);
Expand All @@ -538,7 +538,8 @@ limitations under the License. -->
isRelation: true,
});
if (setPod) {
const destProcess = params.destProcessId || selectorStore.destProcesses[0].id;
const destProcess =
selectorStore.currentDestProcess?.id || params.destProcessId || selectorStore.destProcesses[0].id;
const currentDestProcess = selectorStore.destProcesses.find((d: { id: string }) => d.id === destProcess);
if (!currentDestProcess) {
states.currentDestProcess = "";
Expand Down Expand Up @@ -570,7 +571,7 @@ limitations under the License. -->
states.currentDestPod = "";
return;
}
const destPod = params.destPodId || selectorStore.destPods[0].id;
const destPod = selectorStore.currentDestPod?.id || params.destPodId || selectorStore.destPods[0].id;
const currentDestPod = selectorStore.destPods.find((d: { id: string }) => d.id === destPod);
if (!currentDestPod) {
states.currentDestPod = "";
Expand Down Expand Up @@ -602,7 +603,7 @@ limitations under the License. -->
states.currentPod = "";
return;
}
const pod = params.podId || selectorStore.pods[0].id;
const pod = selectorStore.currentPod?.id || params.podId || selectorStore.pods[0].id;
const currentPod = selectorStore.pods.find((d: { id: string }) => d.id === pod);
if (!currentPod) {
selectorStore.setCurrentPod(null);
Expand Down

0 comments on commit 1945f23

Please sign in to comment.