mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Clearing file preview when user navigates away from preview.
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Some checks failed
CodeQL / Analyze (push) Has been cancelled
This commit is contained in:
parent
d5116054ca
commit
ecac129816
1 changed files with 5 additions and 0 deletions
|
|
@ -193,6 +193,11 @@ export function FilePreviewProvider({children}) {
|
|||
// Navigated to a page which has a file preview active, fetch the information about the file, then display it.
|
||||
if (previewQuery && !previewFile) {
|
||||
initPreviewFile();
|
||||
} else if (!previewQuery && (previewFile || previewModal)) {
|
||||
// User navigated back/forward and preview query is gone, close the preview.
|
||||
// Only close if there's actually a preview open (previewFile or previewModal exists).
|
||||
setPreviewFile(null);
|
||||
setPreviewModal(null);
|
||||
}
|
||||
}, [previewQuery]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue