From b9a73b57fc71f6eb47b3f98154ec61a31f4d57d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20D=C3=ADaz?= <1691872+dgdavid@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:00:58 +0100 Subject: [PATCH] fix(web): make useProductChanges work as expected (#1526) By mistake, https://github.com/openSUSE/agama/pull/1483 introduced a tiny bug in the `useProductChanges` query hook by checking the `event.type` against an empty string instead of the exepected `ProductChanged` event. https://github.com/openSUSE/agama/pull/1483/files#diff-e671c06f4a1cefe3bef4af838681c780f2ba41356d44f72f5ce97be1b6eead66R172-R185 This PR fixes it for properly performs the software config query invalidation. --- web/src/queries/software.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/queries/software.ts b/web/src/queries/software.ts index 9834bf8ec9..fc41aafbea 100644 --- a/web/src/queries/software.ts +++ b/web/src/queries/software.ts @@ -188,7 +188,7 @@ const useProductChanges = () => { if (!client) return; return client.ws().onEvent((event) => { - if (event.type === "") { + if (event.type === "ProductChanged") { queryClient.invalidateQueries({ queryKey: ["software/config"] }); } });