-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix showing "no proposals" when not signed in (#5601)
# Motivation I found a bug that the "no proposals" message is not shown when query+update is enabled (`FORCE_CALL_STRATEGY = undefined`) and the user is not signed in. This happened because `nothingFound` was not updated if `$filteredProposals.certified === false && notForceCallStrategy()`. That is if the proposals are the result of a query response, while we also expect an update response. The first problem is that when the user is not signed in, by default [we don't follow the query call with an update call](https://github.com/dfinity/nns-dapp/blob/a86684b1625ddf972d92052e2ba8e3d31feb21ac/frontend/src/lib/services/utils.services.ts#L72-L74). So the assumption that because `notForceCallStrategy()`, the query call will be followed by an update call, is not true when the user is not signed in. This could be fixed by additionally checking if the user is signed in. But on closer inspection, the whole `nothingFound` field seems to be unnecessary. We already show skeletons when we are loading proposals. So if we are not loading proposals, and we also don't have any proposals, then of course nothing is found. This is analogous to the code on line 67 of `frontend/src/lib/components/proposals/NnsProposalsList.svelte` which does the same for the actionable proposals case. # Changes 1. Remove `nothingFound` and the logic to update it, from `frontend/src/lib/pages/NnsProposals.svelte`. 2. In `frontend/src/lib/components/proposals/NnsProposalsList.svelte` show "nothing found" if we don't show skeletons and also don't have any proposals to show. # Tests 1. Add a unit test that the "nothing found" message is also shown when the user is not signed in. 2. Existing tests pass. # Todos - [x] Add entry to changelog (if necessary).
- Loading branch information
Showing
4 changed files
with
16 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters