From 600ebae73aac30c7923f122b0652321765ac4753 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Thu, 12 Jan 2023 21:20:25 -0600 Subject: [PATCH] fix(gui): clear loading data after card leaves --- gui/src/components/LoadingCard.tsx | 2 ++ gui/src/components/Txt2Img.tsx | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gui/src/components/LoadingCard.tsx b/gui/src/components/LoadingCard.tsx index 5cc21114..b9415395 100644 --- a/gui/src/components/LoadingCard.tsx +++ b/gui/src/components/LoadingCard.tsx @@ -20,6 +20,8 @@ export function LoadingCard(props: LoadingCardProps) { const pushHistory = useStore(mustExist(useContext(StateContext)), (state) => state.pushHistory); const ready = useQuery('ready', () => client.ready(props.loading), { + // data will always be ready without this, even if the API says its not + cacheTime: 0, refetchInterval: POLL_TIME, }); diff --git a/gui/src/components/Txt2Img.tsx b/gui/src/components/Txt2Img.tsx index 69c1ca6c..e293fa65 100644 --- a/gui/src/components/Txt2Img.tsx +++ b/gui/src/components/Txt2Img.tsx @@ -43,8 +43,6 @@ export function Txt2Img(props: Txt2ImgProps) { const setTxt2Img = useStore(state, (s) => s.setTxt2Img); // eslint-disable-next-line @typescript-eslint/unbound-method const setLoading = useStore(state, (s) => s.setLoading); - // eslint-disable-next-line @typescript-eslint/unbound-method - const pushHistory = useStore(state, (s) => s.pushHistory); return