Skip to content

Commit

Permalink
Merge pull request Kitware#556 from PaulHax/save-param
Browse files Browse the repository at this point in the history
fix(App): keep query params on save url query param
  • Loading branch information
PaulHax authored Mar 1, 2024
2 parents f5e5087 + 14c6f1e commit 3cadfb0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/components/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,14 @@ export default defineComponent({
// --- save state --- //
const remoteSaveStateStore = useRemoteSaveStateStore();
if (import.meta.env.VITE_ENABLE_REMOTE_SAVE && urlParams.save) {
remoteSaveStateStore.setSaveUrl(urlParams.save.toString());
// Avoid dropping JSON or array query param arguments on the "save" query parameter
// by parsing query params without casting to native types in vtkURLExtract.
const queryParams = new URLSearchParams(window.location.search);
const saveUrl = queryParams.get('save');
if (saveUrl) {
useRemoteSaveStateStore().setSaveUrl(saveUrl);
}
}
// --- layout --- //
Expand Down

0 comments on commit 3cadfb0

Please sign in to comment.