diff --git a/src/components/TeamMembers/LeaveTeamPopup.tsx b/src/components/TeamMembers/LeaveTeamPopup.tsx index 153d21636..c84452f5a 100644 --- a/src/components/TeamMembers/LeaveTeamPopup.tsx +++ b/src/components/TeamMembers/LeaveTeamPopup.tsx @@ -45,7 +45,7 @@ export function LeaveTeamPopup(props: LeaveTeamPopupProps) { return; } - window.location.href = '/account'; + window.location.href = '/account?c=tl'; }; const handleClosePopup = () => { diff --git a/src/components/Toast.tsx b/src/components/Toast.tsx index a5b844a5d..372ba0d9d 100644 --- a/src/components/Toast.tsx +++ b/src/components/Toast.tsx @@ -6,12 +6,26 @@ import { ErrorIcon } from './ReactIcons/ErrorIcon'; import { WarningIcon } from './ReactIcons/WarningIcon'; import { InfoIcon } from './ReactIcons/InfoIcon'; import { Spinner } from './ReactIcons/Spinner'; +import { deleteUrlParam, getUrlParams, setUrlParams } from '../lib/browser'; export interface Props {} +const messageCodes: Record = { + tl: 'Successfully left the team', +}; + export function Toaster(props: Props) { const toastMessage = useStore($toastMessage); + const { c } = getUrlParams(); + if (c) { + deleteUrlParam('c'); + + if (messageCodes[c]) { + $toastMessage.set({ type: 'success', message: messageCodes[c] }); + } + } + useEffect(() => { if (toastMessage === undefined) { return; diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 149fcb074..22ad7fa90 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -156,7 +156,7 @@ const gaPageIdentifier = Astro.url.pathname - +