From 2eaeb892d3ca440528f3a0c2465af7ad2a5d3cde Mon Sep 17 00:00:00 2001 From: andrewwallacespeckle Date: Thu, 5 Jun 2025 15:08:19 +0200 Subject: [PATCH] Use boolean pendingIsAutoJoinEnabled --- .../settings/workspaces/security/Discoverability.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/frontend-2/components/settings/workspaces/security/Discoverability.vue b/packages/frontend-2/components/settings/workspaces/security/Discoverability.vue index d61ab0ddc..52367ebe1 100644 --- a/packages/frontend-2/components/settings/workspaces/security/Discoverability.vue +++ b/packages/frontend-2/components/settings/workspaces/security/Discoverability.vue @@ -119,7 +119,7 @@ const { mutate: updateAutoJoin } = useMutation(workspaceUpdateAutoJoinMutation) const { triggerNotification } = useGlobalToast() const showConfirmJoinPolicyDialog = ref(false) -const pendingJoinPolicy = ref() +const pendingIsAutoJoinEnabled = ref(false) const currentJoinPolicy = ref() const workspaceDomains = computed(() => { @@ -209,7 +209,7 @@ const handleJoinPolicyUpdate = async (newValue: JoinPolicy, confirmed = false) = // If enabling auto-join and not yet confirmed, show confirmation dialog if (newValue === JoinPolicy.AutoJoin && !confirmed) { showConfirmJoinPolicyDialog.value = true - pendingJoinPolicy.value = newValue + pendingIsAutoJoinEnabled.value = true return } @@ -227,7 +227,7 @@ const handleJoinPolicyUpdate = async (newValue: JoinPolicy, confirmed = false) = // Reset dialog state if it was open if (showConfirmJoinPolicyDialog.value) { showConfirmJoinPolicyDialog.value = false - pendingJoinPolicy.value = undefined + pendingIsAutoJoinEnabled.value = false } const notificationConfig = @@ -256,8 +256,8 @@ const handleJoinPolicyUpdate = async (newValue: JoinPolicy, confirmed = false) = } const handleJoinPolicyConfirm = async () => { - if (!pendingJoinPolicy.value) return - await handleJoinPolicyUpdate(pendingJoinPolicy.value, true) + if (!pendingIsAutoJoinEnabled.value) return + await handleJoinPolicyUpdate(JoinPolicy.AutoJoin, true) } const handleJoinPolicyCancel = () => { @@ -268,7 +268,7 @@ const handleJoinPolicyCancel = () => { // Close dialog and reset pending state showConfirmJoinPolicyDialog.value = false - pendingJoinPolicy.value = undefined + pendingIsAutoJoinEnabled.value = false } const handleRadioChange = (newValue: JoinPolicy) => {