Refresh Fleet with discovery, operation progress, and lobby watches
This commit is contained in:
+4
-2
@@ -14,6 +14,7 @@ export interface Toast {
|
||||
message: string;
|
||||
variant: ToastVariant;
|
||||
ttl: number;
|
||||
href?: string;
|
||||
}
|
||||
|
||||
export const toasts = writable<Toast[]>([]);
|
||||
@@ -22,13 +23,14 @@ let nextId = 1;
|
||||
|
||||
export function toast(
|
||||
message: string,
|
||||
opts: { variant?: ToastVariant; ttl?: number } = {}
|
||||
opts: { variant?: ToastVariant; ttl?: number; href?: string } = {}
|
||||
): void {
|
||||
const t: Toast = {
|
||||
id: nextId++,
|
||||
message,
|
||||
variant: opts.variant ?? 'info',
|
||||
ttl: opts.ttl ?? 3500
|
||||
ttl: opts.ttl ?? 3500,
|
||||
href: opts.href
|
||||
};
|
||||
toasts.update((arr) => [...arr, t]);
|
||||
if (t.ttl > 0) {
|
||||
|
||||
Reference in New Issue
Block a user