mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-17 12:42:21 +03:00
fix(dashboard): type the reorder hook's notifier explicitly (dashboard-typecheck TS2339)
ReturnType<typeof useNotificationStore> resolves to unknown under the dashboard-scoped tsconfig gate (#7203), so notify.error tripped TS2339. The hook only needs error(), so declare that minimal surface directly.
This commit is contained in:
@@ -18,9 +18,11 @@
|
||||
import { useState } from "react";
|
||||
import { sortConnectionsByAvailability } from "../components/connectionRowHelpers";
|
||||
import type { ConnectionRowConnection } from "../components/ConnectionRow";
|
||||
import { useNotificationStore } from "@/store/notificationStore";
|
||||
|
||||
type NotifyStore = ReturnType<typeof useNotificationStore>;
|
||||
/** Minimal surface of the notification store this hook needs. */
|
||||
interface ReorderNotifier {
|
||||
error: (message: string) => void;
|
||||
}
|
||||
|
||||
export interface UseReorderByAvailabilityParams {
|
||||
connections: ConnectionRowConnection[];
|
||||
@@ -30,7 +32,7 @@ export interface UseReorderByAvailabilityParams {
|
||||
| ((prev: ConnectionRowConnection[]) => ConnectionRowConnection[])
|
||||
) => void;
|
||||
fetchConnections: () => Promise<void>;
|
||||
notify: NotifyStore;
|
||||
notify: ReorderNotifier;
|
||||
t: (key: string, params?: Record<string, unknown>) => string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user