Skip to content

Commit

Permalink
fix: skip the confirm save modal when the user do not have permission (
Browse files Browse the repository at this point in the history
…#4343)

* fix: skip the confirm save modal when the user do not have permission

* format fix

* Refactor

---------

Co-authored-by: ChaituVR <yourchaitu@gmail.com>
Co-authored-by: Sam <samuv.eth@gmail.com>
  • Loading branch information
3 people authored Nov 15, 2023
1 parent 7182cc5 commit b9bdfde
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/views/SpaceSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,16 +168,16 @@ const {
cancel: cancelDelete
} = useConfirmDialog();
const isViewOnly = computed(() => {
return !(isSpaceController.value || isSpaceAdmin.value);
});
onBeforeRouteLeave(async () => {
if (hasFormChanged.value) {
if (hasFormChanged.value && !isViewOnly.value) {
const { data } = await openConfirmLeave();
if (!data) return false;
}
});
const isViewOnly = computed(() => {
return !(isSpaceController.value || isSpaceAdmin.value);
});
</script>

<template>
Expand Down

1 comment on commit b9bdfde

@vercel
Copy link

@vercel vercel bot commented on b9bdfde Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.