frontend
This commit is contained in:
+6
-15
@@ -1,3 +1,5 @@
|
||||
import '@fontsource/inter/400.css';
|
||||
|
||||
import React, {
|
||||
useCallback,
|
||||
useContext,
|
||||
@@ -368,15 +370,11 @@ const AppLayout = () => {
|
||||
const stored = window.localStorage.getItem('papercrate_view_mode');
|
||||
return stored === 'grid' ? 'grid' : 'list';
|
||||
});
|
||||
const initialRowSelection = routeDocumentId
|
||||
? [resolveDocumentRowKey(routeDocumentId)]
|
||||
: [];
|
||||
const initialRowSelection = [];
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState(initialRowSelection);
|
||||
const [selectionOrder, setSelectionOrder] = useState(initialRowSelection);
|
||||
const [focusedDocumentId, setFocusedDocumentId] = useState(routeDocumentId);
|
||||
const [focusedRowKey, setFocusedRowKey] = useState(() =>
|
||||
routeDocumentId ? resolveDocumentRowKey(routeDocumentId) : null,
|
||||
);
|
||||
const [focusedDocumentId, setFocusedDocumentId] = useState(null);
|
||||
const [focusedRowKey, setFocusedRowKey] = useState(null);
|
||||
const tokenRef = useRef(token);
|
||||
const refreshPromiseRef = useRef(null);
|
||||
const breadcrumbFetchRef = useRef(new Set());
|
||||
@@ -816,14 +814,7 @@ const AppLayout = () => {
|
||||
if (selectionInitializedRef.current) {
|
||||
nextDocKeys = previousDocKeys.filter((key) => availableDocKeySet.has(key));
|
||||
} else {
|
||||
const filtered = previousDocKeys.filter((key) => availableDocKeySet.has(key));
|
||||
if (filtered.length) {
|
||||
nextDocKeys = filtered;
|
||||
} else if (availableDocKeys.length) {
|
||||
nextDocKeys = [availableDocKeys[0]];
|
||||
} else {
|
||||
nextDocKeys = [];
|
||||
}
|
||||
nextDocKeys = previousDocKeys.filter((key) => availableDocKeySet.has(key));
|
||||
}
|
||||
|
||||
mergedSelection = [...previousFolderKeys, ...nextDocKeys];
|
||||
|
||||
Reference in New Issue
Block a user