diff --git a/confiture-web-app/package.json b/confiture-web-app/package.json index 948f47924..bfc963977 100644 --- a/confiture-web-app/package.json +++ b/confiture-web-app/package.json @@ -26,7 +26,7 @@ "slugify": "^1.6.5", "vue": "^3.2.45", "vue-matomo": "^4.2.0", - "vue-router": "^4.1.6" + "vue-router": "^4.2.5" }, "devDependencies": { "@sentry/vite-plugin": "^0.3.0", diff --git a/confiture-web-app/src/composables/useWrappedFetch.ts b/confiture-web-app/src/composables/useWrappedFetch.ts index cc68581f6..542b45114 100644 --- a/confiture-web-app/src/composables/useWrappedFetch.ts +++ b/confiture-web-app/src/composables/useWrappedFetch.ts @@ -1,6 +1,7 @@ import { onMounted, watch } from "vue"; import { onBeforeRouteLeave, useRoute, useRouter } from "vue-router"; import { TimeoutError } from "ky"; +import { isEqual } from "lodash-es"; import { captureWithPayloads } from "../utils"; @@ -51,8 +52,12 @@ export function useWrappedFetch( if (watchParams) { const watchStopHandle = watch( () => route.params, - () => { - func().catch(handleError); + (newParams, oldParams) => { + // Make sure the params actually changed because if only the hash of the route + // changed, the `params` objects will be equal but different references, which will trigger the watcher + if (!isEqual(newParams, oldParams)) { + func().catch(handleError); + } } ); diff --git a/confiture-web-app/yarn.lock b/confiture-web-app/yarn.lock index 6e10895b7..98de0df65 100644 --- a/confiture-web-app/yarn.lock +++ b/confiture-web-app/yarn.lock @@ -581,6 +581,11 @@ resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.4.5.tgz#d54e844c1adbb1e677c81c665ecef1a2b4bb8380" integrity sha512-JD5fcdIuFxU4fQyXUu3w2KpAJHzTVdN+p4iOX2lMWSHMOoQdMAcpFLZzm9Z/2nmsoZ1a96QEhZ26e50xLBsgOQ== +"@vue/devtools-api@^6.5.0": + version "6.5.1" + resolved "https://registry.yarnpkg.com/@vue/devtools-api/-/devtools-api-6.5.1.tgz#7f71f31e40973eeee65b9a64382b13593fdbd697" + integrity sha512-+KpckaAQyfbvshdDW5xQylLni1asvNSGme1JFs8I1+/H5pHEhqUKMEQD/qn3Nx5+/nycBq11qAEi8lk+LXI2dA== + "@vue/reactivity-transform@3.2.45": version "3.2.45" resolved "https://registry.yarnpkg.com/@vue/reactivity-transform/-/reactivity-transform-3.2.45.tgz#07ac83b8138550c83dfb50db43cde1e0e5e8124d" @@ -1788,12 +1793,12 @@ vue-matomo@^4.2.0: resolved "https://registry.yarnpkg.com/vue-matomo/-/vue-matomo-4.2.0.tgz#d65e369e4ead1d95ef790bef3627512cac3d25e9" integrity sha512-m5hCw7LH3wPDcERaF4sp/ojR9sEx7Rl8TpOyH/4jjQxMF2DuY/q5pO+i9o5Dx+BXLSa9+IQ0qhAbWYRyESQXmA== -vue-router@^4.1.6: - version "4.1.6" - resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.1.6.tgz#b70303737e12b4814578d21d68d21618469375a1" - integrity sha512-DYWYwsG6xNPmLq/FmZn8Ip+qrhFEzA14EI12MsMgVxvHFDYvlr4NXpVF5hrRH1wVcDP8fGi5F4rxuJSl8/r+EQ== +vue-router@^4.2.5: + version "4.2.5" + resolved "https://registry.yarnpkg.com/vue-router/-/vue-router-4.2.5.tgz#b9e3e08f1bd9ea363fdd173032620bc50cf0e98a" + integrity sha512-DIUpKcyg4+PTQKfFPX88UWhlagBEBEfJ5A8XDXRJLUnZOvcpMF8o/dnL90vpVkGaPbjvXazV/rC1qBKrZlFugw== dependencies: - "@vue/devtools-api" "^6.4.5" + "@vue/devtools-api" "^6.5.0" vue-template-compiler@^2.7.14: version "2.7.14"