Skip to content

Commit

Permalink
fix(web): make useProductChanges work as expected (#1526)
Browse files Browse the repository at this point in the history
By mistake, #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.
  • Loading branch information
dgdavid authored Aug 2, 2024
1 parent b6de3f1 commit b9a73b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/src/queries/software.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"] });
}
});
Expand Down

0 comments on commit b9a73b5

Please sign in to comment.