Skip to content

Commit

Permalink
fix(gui): invalidate loading query after mutations
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 13, 2023
1 parent 64801a5 commit fa639ef
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gui/src/components/Img2Img.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function Img2Img(props: Img2ImgProps) {
const client = mustExist(useContext(ClientContext));
const query = useQueryClient();
const upload = useMutation(uploadSource, {
onSuccess: () => query.invalidateQueries({ queryKey: 'ready '}),
onSuccess: () => query.invalidateQueries({ queryKey: 'ready' }),
});

const state = mustExist(useContext(StateContext));
Expand Down
4 changes: 1 addition & 3 deletions gui/src/components/Inpaint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,10 @@ export function Inpaint(props: InpaintProps) {
const setInpaint = useStore(state, (s) => s.setInpaint);
// 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);

const query = useQueryClient();
const upload = useMutation(uploadSource, {
onSuccess: () => query.invalidateQueries({ queryKey: 'ready '}),
onSuccess: () => query.invalidateQueries({ queryKey: 'ready' }),
});
// eslint-disable-next-line no-null/no-null
const canvasRef = useRef<HTMLCanvasElement>(null);
Expand Down
2 changes: 1 addition & 1 deletion gui/src/components/Txt2Img.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function Txt2Img(props: Txt2ImgProps) {
const client = mustExist(useContext(ClientContext));
const query = useQueryClient();
const generate = useMutation(generateImage, {
onSuccess: () => query.invalidateQueries({ queryKey: 'ready '}),
onSuccess: () => query.invalidateQueries({ queryKey: 'ready' }),
});

const state = mustExist(useContext(StateContext));
Expand Down

0 comments on commit fa639ef

Please sign in to comment.