Skip to content

Commit 29f5fde

Browse files
authored
chore: Fix the loading state when updating roles twice in a row (supabase#37438)
Fix the loading state when updating roles twice in a row.
1 parent 0620e2d commit 29f5fde

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

apps/studio/components/interfaces/Organization/TeamSettings/UpdateRolesPanel/UpdateRolesConfirmationModal.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,11 @@ export const UpdateRolesConfirmationModal = ({
9090
})
9191
toast.success(`Successfully updated role for ${member.username}`)
9292
onClose(true)
93-
return
9493
} catch (error: any) {
94+
toast.error(`Failed to update role: ${error.message}`)
95+
} finally {
9596
setSaving(false)
96-
return toast.error(`Failed to update role: ${error.message}`)
97+
return
9798
}
9899
}
99100

@@ -130,8 +131,10 @@ export const UpdateRolesConfirmationModal = ({
130131
toast.success(`Successfully updated role for ${member.username}`)
131132
onClose(true)
132133
} catch (error: any) {
134+
toast.error(`Failed to update role: ${error.message}`)
135+
} finally {
133136
setSaving(false)
134-
return toast.error(`Failed to update role: ${error.message}`)
137+
return
135138
}
136139
}
137140

0 commit comments

Comments
 (0)