Skip to content

Commit

Permalink
Change Logic and watch email switch
Browse files Browse the repository at this point in the history
  • Loading branch information
jatindersingh93 committed May 1, 2024
1 parent 82613b6 commit b5785e4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions frontend/src/components/common/InviteButton.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { storeToRefs } from 'pinia';
import { computed, ref, onMounted } from 'vue';
import { computed, ref, onMounted, watch } from 'vue';
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
import ShareLinkContent from '@/components/object/share/ShareLinkContent.vue';
Expand Down Expand Up @@ -63,6 +63,7 @@ const hasManagePermission: Ref<boolean> = computed(() => {
? permissionStore.isObjectActionAllowed(props.objectId, getUserId.value, Permissions.MANAGE)
: permissionStore.isBucketActionAllowed(props.bucketId, getUserId.value, Permissions.MANAGE);
});
const resource = props.objectId ? 'object' : 'bucket';
// Share link
const inviteLink: Ref<string> = ref('');
Expand Down Expand Up @@ -92,7 +93,7 @@ const displayInviteDialog = ref(false);
// Permissions selection
const selectedOptions = computed(() => {
return props.labelText === 'Bucket' ? bucketPermCodes : objectPermCodes;
return resource === 'bucket' ? bucketPermCodes : objectPermCodes;
});
// Share link
const bcBoxLink = computed(() => {
Expand All @@ -108,6 +109,12 @@ const isOptionUnselectable = (optionName: string) => {
return optionName === 'Read';
};
watch(isRestricted, () => {
if (formData.value.email) {
formData.value.email = '';
}
});
//Action
async function sendInvite() {
try {
Expand Down

0 comments on commit b5785e4

Please sign in to comment.