diff options
author | Paul Frazee <pfrazee@gmail.com> | 2023-07-07 12:00:17 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-07 12:00:17 -0500 |
commit | 237e957d1699fb4da756e9acc98c527f282e90b0 (patch) | |
tree | e1bcfceccbb0747b3e234407c9a3612d010ccaaa /src/state/models/ui/shell.ts | |
parent | d8aded7b15ba6a59750ec877fae63fa2a64afe4c (diff) | |
download | voidsky-237e957d1699fb4da756e9acc98c527f282e90b0.tar.zst |
Fixes and improvements to the Profile Preview modal (#992)
* Fix: use more reliable navigation method * Fix: show lightbox over the active modal * Fix: close the profile preview on navigation * Factor out UserPreviewLink and add preview behavior to notifications * Fix postmeta overflow on web * Fix lint
Diffstat (limited to 'src/state/models/ui/shell.ts')
-rw-r--r-- | src/state/models/ui/shell.ts | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/state/models/ui/shell.ts b/src/state/models/ui/shell.ts index c6e7289df..a0e0cd7b2 100644 --- a/src/state/models/ui/shell.ts +++ b/src/state/models/ui/shell.ts @@ -279,6 +279,24 @@ export class ShellUiModel { return false } + /** + * used to clear out any modals, eg for a navigation + */ + closeAllActiveElements() { + if (this.isLightboxActive) { + this.closeLightbox() + } + while (this.isModalActive) { + this.closeModal() + } + if (this.isComposerActive) { + this.closeComposer() + } + if (this.isDrawerOpen) { + this.closeDrawer() + } + } + openDrawer() { this.isDrawerOpen = true } |