From 84d66a1c3b3cf8ad32213ae28e02a2ef8627f529 Mon Sep 17 00:00:00 2001 From: John Costa Date: Sat, 26 Apr 2025 20:36:10 +0100 Subject: [PATCH] shameful comment --- frontend/src/contexts/SearchImageContext.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/frontend/src/contexts/SearchImageContext.tsx b/frontend/src/contexts/SearchImageContext.tsx index a4c0427..6e0c9c2 100644 --- a/frontend/src/contexts/SearchImageContext.tsx +++ b/frontend/src/contexts/SearchImageContext.tsx @@ -44,6 +44,15 @@ const getAllValues = (object: object): Array => { return loop([], object); }; +// On fast connections (or locally), the DB will send the complete update before the image has been fully saved. +// This is because it shouldn't really be an update, and that is hacky but hey. It works. +// The tech debt will be collected eventually. +// +// AND MORE IMPORTANTLY. The fucking AI agents aren't done. +// hhhhhhhhhhhhhhhhhhhhmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm +// wait groups. +const BIG_SHAME_TIMEOUT = 5000; + const SearchImageContext = createContext(); export const SearchImageContextProvider: Component = (props) => { const [images, { refetch }] = createResource(() => @@ -59,7 +68,7 @@ export const SearchImageContextProvider: Component = (props) => { setTimeout(refetch, BIG_SHAME_TIMEOUT), }} > {props.children}