mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-10 03:03:37 +02:00
Remove useToast everywhere
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user