diff --git a/frontend/src/ProtectedRoute.tsx b/frontend/src/ProtectedRoute.tsx index 6bd8bd8..d6bd913 100644 --- a/frontend/src/ProtectedRoute.tsx +++ b/frontend/src/ProtectedRoute.tsx @@ -4,6 +4,7 @@ import { jwtDecode } from "jwt-decode"; import { type Component, type ParentProps, Show, useContext } from "solid-js"; import { save_token } from "tauri-plugin-ios-shared-token-api"; import { Notifications, NotificationsContext } from "./notifications"; +import { useSearchImageContext } from "./contexts/SearchImageContext"; export const isTokenValid = (): boolean => { const token = localStorage.getItem("access"); @@ -21,7 +22,8 @@ export const isTokenValid = (): boolean => { }; const WithNotifications: Component = (props) => { - const notifications = Notifications(); + const { onRefetchImages } = useSearchImageContext(); + const notifications = Notifications(onRefetchImages); return ( diff --git a/frontend/src/Search.tsx b/frontend/src/Search.tsx index d7357e4..46afda4 100644 --- a/frontend/src/Search.tsx +++ b/frontend/src/Search.tsx @@ -17,7 +17,6 @@ import { base, type UserImage } from "./network"; import { useSearchImageContext } from "./contexts/SearchImageContext"; import { A } from "@solidjs/router"; import { useSetEntity } from "./WithEntityDialog"; -import { useNotifications } from "./ProtectedRoute"; import { ProcessingImages } from "./notifications/ProcessingImages"; export const Search = () => { diff --git a/frontend/src/notifications/index.ts b/frontend/src/notifications/index.ts index 5bd5e8a..7f66f87 100644 --- a/frontend/src/notifications/index.ts +++ b/frontend/src/notifications/index.ts @@ -24,7 +24,7 @@ type NotificationState = { >; }; -export const Notifications = () => { +export const Notifications = (onCompleteImage: () => void) => { const [state, setState] = createStore({ ProcessingImages: {}, }); @@ -66,6 +66,7 @@ export const Notifications = () => { } setState("ProcessingImages", ImageID, undefined); + onCompleteImage(); } else { if (Status !== "in-progress") { console.error(