Skip to content

Commit

Permalink
Watch and compare route before re-invoking fetch() in ResourceDetail
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Rak <[email protected]>
  • Loading branch information
rak-phillip committed Oct 16, 2024
1 parent d0c3c5a commit b594d6b
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions shell/components/ResourceDetail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,12 @@ export default {
},
watch: {
'$route.query'(inNeu, inOld) {
const neu = clone(inNeu);
const old = clone(inOld);
'$route'(current, prev) {
if (current.name !== prev.name) {
return;
}
const neu = clone(current.query);
const old = clone(prev.query);
delete neu[PREVIEW];
delete old[PREVIEW];
Expand All @@ -332,10 +335,6 @@ export default {
const queryDiff = Object.keys(diff(neu, old));
if (Object.keys(neu).length <= 0) {
return;
}
if (queryDiff.includes(MODE) || queryDiff.includes(AS)) {
this.$fetch();
}
Expand Down

0 comments on commit b594d6b

Please sign in to comment.