Fix viewer close on deletion of last file
This commit is contained in:
@@ -827,8 +827,10 @@ export const FileViewer: React.FC<FileViewerProps> = ({
|
|||||||
}, [handleClose, files]);
|
}, [handleClose, files]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
psRef.current?.refreshCurrentSlideFavoriteButtonIfNeeded();
|
if (open) {
|
||||||
}, [favoriteFileIDs, pendingFavoriteUpdates]);
|
psRef.current?.refreshCurrentSlideFavoriteButtonIfNeeded();
|
||||||
|
}
|
||||||
|
}, [favoriteFileIDs, pendingFavoriteUpdates, open]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (open) {
|
if (open) {
|
||||||
@@ -840,7 +842,9 @@ export const FileViewer: React.FC<FileViewerProps> = ({
|
|||||||
disableDownload,
|
disableDownload,
|
||||||
haveUser,
|
haveUser,
|
||||||
delegate: delegateRef.current!,
|
delegate: delegateRef.current!,
|
||||||
onClose: handleClose,
|
onClose: () => {
|
||||||
|
if (psRef.current) handleClose();
|
||||||
|
},
|
||||||
onAnnotate: handleAnnotate,
|
onAnnotate: handleAnnotate,
|
||||||
onViewInfo: handleViewInfo,
|
onViewInfo: handleViewInfo,
|
||||||
onDownload: handleDownloadBarAction,
|
onDownload: handleDownloadBarAction,
|
||||||
|
|||||||
Reference in New Issue
Block a user