Remove useToast everywhere

This commit is contained in:
Gregory Schier
2025-01-06 12:21:21 -08:00
parent ab55c2e0ce
commit 806a8eb801
14 changed files with 58 additions and 84 deletions

View File

@@ -1,10 +1,9 @@
import { useEffect, useState } from 'react';
import { InlineCode } from '../components/core/InlineCode';
import { useActiveWorkspace } from './useActiveWorkspace';
import { useToast } from './useToast';
import { showToast } from '../lib/toast';
export function useActiveWorkspaceChangedToast() {
const toast = useToast();
const activeWorkspace = useActiveWorkspace();
const [id, setId] = useState<string | null>(activeWorkspace?.id ?? null);
@@ -17,7 +16,7 @@ export function useActiveWorkspaceChangedToast() {
// Don't notify on the first load
if (id === null) return;
toast.show({
showToast({
id: `workspace-changed-${activeWorkspace.id}`,
timeout: 3000,
message: (
@@ -27,5 +26,5 @@ export function useActiveWorkspaceChangedToast() {
</>
),
});
}, [activeWorkspace, id, toast]);
}, [activeWorkspace, id]);
}