Allow dismissing 'Key storage out of sync' temporarily#31455
Allow dismissing 'Key storage out of sync' temporarily#31455andybalaam merged 1 commit intodevelopfrom
Conversation
richvdh
left a comment
There was a problem hiding this comment.
My suspicion is that, without changes to DeviceListener, this will pop up again next time there is any change to devices, etc
I'm sure you're right, thanks. I'll check this. |
It turns out this change does actually update state, because it calls So I think this change actually does what it should :-) |
c5d1d58 to
6e51ba5
Compare
6e51ba5 to
da03f08
Compare
da03f08 to
3c69526
Compare
|
This is ready for review after a design change. It now uses an "X" in the top right. |
src/stores/ToastStore.ts
Outdated
| className?: string; | ||
| bodyClassName?: string; | ||
|
|
||
| /** If defined, the toast has a close button in the top right */ |
There was a problem hiding this comment.
If defined, the toast has a close button in the top right
If that's all it means, why not use a boolean?
Presumably onClose gets called when the close button is pressed, but please join the dots a bit. Is the toast automatically closed, or is onClose expected to do that? (I think the latter, but then it should probably be called onCloseButtonClicked or sth)
| {title} | ||
| </Text> | ||
| </div> | ||
| {onClose && ( |
There was a problem hiding this comment.
it looks like onClose will only work if a title is specified. We should note that in the documentation on IToast.
src/toasts/SetupEncryptionToast.tsx
Outdated
| key: TOAST_KEY, | ||
| title: getTitle(state), | ||
| icon: getIcon(state), | ||
| onClose: getOnClose(state), |
There was a problem hiding this comment.
I feel like this would be easier to grok if the get... method just returned a boolean rather than the callback:
const getShouldShowCloseButton = (state: DeviceStateForToast): boolean => { /* ... */ };
// inside `showToast`
const onClose = shouldShowCloseButton(state)
? () => DeviceListener.sharedInstance().dismissEncryptionSetup()
: undefined;
src/toasts/SetupEncryptionToast.tsx
Outdated
| case "key_storage_out_of_sync": | ||
| case "identity_needs_reset": | ||
| return () => DeviceListener.sharedInstance().dismissEncryptionSetup(); | ||
| default: |
There was a problem hiding this comment.
I'd prefer to spell out each of the cases here, to try to encourage people to think about whether we need a close button if we add more cases in future.
a7ae16a to
5e21c8d
Compare
…880) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [element-hq/element-web](https://github.com/element-hq/element-web) | patch | `v1.12.9` → `v1.12.10` | --- ### Release Notes <details> <summary>element-hq/element-web (element-hq/element-web)</summary> ### [`v1.12.10`](https://github.com/element-hq/element-web/releases/tag/v1.12.10) [Compare Source](element-hq/element-web@v1.12.9...v1.12.10) #### ✨ Features - Support additional\_creators in /upgraderoom (MSC4289) ([#​31934](element-hq/element-web#31934)). Contributed by [@​andybalaam](https://github.com/andybalaam). - Update room header icon for world\_readable rooms ([#​31915](element-hq/element-web#31915)). Contributed by [@​richvdh](https://github.com/richvdh). - Show an icon in the room header for shared history ([#​31879](element-hq/element-web#31879)). Contributed by [@​richvdh](https://github.com/richvdh). - Remove "history may be shared" banner. ([#​31881](element-hq/element-web#31881)). Contributed by [@​kaylendog](https://github.com/kaylendog). - Allow dismissing 'Key storage out of sync' temporarily ([#​31455](element-hq/element-web#31455)). Contributed by [@​andybalaam](https://github.com/andybalaam). - Add `resolutions` entry for `matrix-widget-api` to package.json ([#​31851](element-hq/element-web#31851)). Contributed by [@​toger5](https://github.com/toger5). - Improve visibility under contrast control mode ([#​31847](element-hq/element-web#31847)). Contributed by [@​t3chguy](https://github.com/t3chguy). - Unread Sorting - Add option for sorting in `OptionsMenuView` ([#​31754](element-hq/element-web#31754)). Contributed by [@​MidhunSureshR](https://github.com/MidhunSureshR). - Unread sorting - Implement sorter and use it in the room list store ([#​31723](element-hq/element-web#31723)). Contributed by [@​MidhunSureshR](https://github.com/MidhunSureshR). - Allow Element Call widgets to receive sticky events ([#​31843](element-hq/element-web#31843)). Contributed by [@​robintown](https://github.com/robintown). - Improve icon rendering accessibility ([#​31791](element-hq/element-web#31791)). Contributed by [@​t3chguy](https://github.com/t3chguy). - Add message preview toggle to room list header option ([#​31821](element-hq/element-web#31821)). Contributed by [@​florianduros](https://github.com/florianduros). #### 🐛 Bug Fixes - \[Backport staging] Fix room list not being cleared ([#​32438](element-hq/element-web#32438)). Contributed by [@​RiotRobot](https://github.com/RiotRobot). - Fix failure to update room info panel on joinrule change ([#​31938](element-hq/element-web#31938)). Contributed by [@​richvdh](https://github.com/richvdh). - Throttle space notification state calculation ([#​31922](element-hq/element-web#31922)). Contributed by [@​dbkr](https://github.com/dbkr). - Fix emoji verification responsive layout ([#​31899](element-hq/element-web#31899)). Contributed by [@​t3chguy](https://github.com/t3chguy). - Add patch for linkify to fix doctype handling ([#​31900](element-hq/element-web#31900)). Contributed by [@​dbkr](https://github.com/dbkr). - Fix rooms with no messages appearing at the top of the room list ([#​31798](element-hq/element-web#31798)). Contributed by [@​MidhunSureshR](https://github.com/MidhunSureshR). - Fix room list menu flashes when menu is closed ([#​31868](element-hq/element-web#31868)). Contributed by [@​florianduros](https://github.com/florianduros). - Message preview toggle is inverted in room list header ([#​31865](element-hq/element-web#31865)). Contributed by [@​florianduros](https://github.com/florianduros). - Fix duplicate toasts appearing for the same call if two events appear. ([#​31693](element-hq/element-web#31693)). Contributed by [@​Half-Shot](https://github.com/Half-Shot). - Fix ability to send rageshake during session restore failure ([#​31848](element-hq/element-web#31848)). Contributed by [@​t3chguy](https://github.com/t3chguy). - Fix mis-alignment of `Threads` right panel title ([#​31849](element-hq/element-web#31849)). Contributed by [@​t3chguy](https://github.com/t3chguy). - Unset buttons does not include color inherit ([#​31801](element-hq/element-web#31801)). Contributed by [@​Philldomd](https://github.com/Philldomd). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4zLjYiLCJ1cGRhdGVkSW5WZXIiOiI0My4zLjYiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbImF1dG9tZXJnZSIsImltYWdlIl19--> Reviewed-on: https://gitea.alexlebens.dev/alexlebens/infrastructure/pulls/3880 Co-authored-by: Renovate Bot <renovate-bot@alexlebens.net> Co-committed-by: Renovate Bot <renovate-bot@alexlebens.net>
Adds a close button to the "Key storage out of sync" toast, which closes the dialog for this session only.
Fixes #30959