Skip to content

Commit 5493e38

Browse files
committed
improve UI notif
1 parent 24640fb commit 5493e38

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

  • apps/sim/app/workspace/[workspaceId]/settings/components/teammates

apps/sim/app/workspace/[workspaceId]/settings/components/teammates/teammates.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use client'
22

33
import { useCallback, useMemo, useState } from 'react'
4+
import { getErrorMessage } from '@sim/utils/errors'
45
import { useQueryClient } from '@tanstack/react-query'
56
import { useParams, useRouter } from 'next/navigation'
67
import {
@@ -15,6 +16,7 @@ import {
1516
MoreHorizontal,
1617
Plus,
1718
Search,
19+
toast,
1820
} from '@/components/emcn'
1921
import type { WorkspacePermission } from '@/lib/api/contracts/workspaces'
2022
import {
@@ -284,7 +286,19 @@ export function Teammates() {
284286
className='text-[var(--text-error)]'
285287
onSelect={() => {
286288
if (teammate.userId) {
287-
removeMember.mutate({ userId: teammate.userId, workspaceId })
289+
removeMember.mutate(
290+
{ userId: teammate.userId, workspaceId },
291+
{
292+
onError: (error) => {
293+
toast.error("Couldn't remove teammate", {
294+
description: getErrorMessage(
295+
error,
296+
'Please try again in a moment.'
297+
),
298+
})
299+
},
300+
}
301+
)
288302
}
289303
}}
290304
>

0 commit comments

Comments
 (0)