fix(library): keep the shell the deploy replaced out of a failed navigation, and say when another tab holds the library open
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
listEditedIds,
|
||||
listFolders,
|
||||
normPath,
|
||||
onLibraryBlocked,
|
||||
pickFolder,
|
||||
readPhotoFile,
|
||||
readPhotos,
|
||||
@@ -376,6 +377,15 @@ function Catalogue() {
|
||||
// the folders and cannot tell whether the remembered subfolder still exists.
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
|
||||
// Whether another tab still holds the library database at the version it was
|
||||
// opened with — a tab left open across a build. Nothing can be read until it
|
||||
// goes, and the screen would otherwise sit blank with no reason on it.
|
||||
const [libraryBlocked, setLibraryBlocked] = useState(false);
|
||||
useEffect(() => {
|
||||
onLibraryBlocked(setLibraryBlocked);
|
||||
return () => onLibraryBlocked(null);
|
||||
}, []);
|
||||
|
||||
// The folder the catalogue is copied into, and whether the browser is still
|
||||
// letting this page write to it — which it stops doing when the tab closes, so
|
||||
// the row below says so rather than letting a write fail quietly. The ref is
|
||||
@@ -1614,6 +1624,12 @@ function Catalogue() {
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{libraryBlocked ? (
|
||||
<p className="hint adm-note" data-key="lib-blocked">
|
||||
{t('lib.blocked')}
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
{/* The folders are on their way in for as long as the catalogue behind
|
||||
them is being read back, and a screen that says there is no folder
|
||||
before it has looked is a screen that says it every visit. */}
|
||||
|
||||
Reference in New Issue
Block a user