Skip to content

Commit d8d3a67

Browse files
committed
fix(filemanager): fix invalid uri when using scrolling triggers cursor pagination
1 parent f49ce46 commit d8d3a67

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/component/FileManager/Explorer/GalleryView/GalleryView.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import DndWrappedFile from "../../Dnd/DndWrappedFile.tsx";
77
import { FmIndexContext } from "../../FmIndexContext.tsx";
88
import { FmFile, loadingPlaceHolderNumb } from "../GridView/GridView.tsx";
99
import GalleryImage from "./GalleryImage.tsx";
10+
import { CrUriPrefix } from "../../../../util/uri.ts";
1011

1112
const GalleryView = React.forwardRef(
1213
(
@@ -52,8 +53,8 @@ const GalleryView = React.forwardRef(
5253
const id = `loadingPlaceholder-${pagination.next_token}-${i}`;
5354
list.push({
5455
...files[0],
55-
path: "/" + id,
56-
id: `loadingPlaceholder-${pagination.next_token}-${i}`,
56+
path: `${CrUriPrefix}${id}`,
57+
id: id,
5758
first: i == 0,
5859
placeholder: true,
5960
});

src/component/FileManager/Explorer/GridView/GridView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { useTranslation } from "react-i18next";
44
import { FileResponse, FileType } from "../../../../api/explorer.ts";
55
import { useAppSelector } from "../../../../redux/hooks.ts";
66
import DndWrappedFile from "../../Dnd/DndWrappedFile.tsx";
7-
87
import { FmIndexContext } from "../../FmIndexContext.tsx";
98
import GridFile from "./GridFile.tsx";
9+
import { CrUriPrefix } from "../../../../util/uri.ts";
1010

1111
export interface GridViewProps {
1212
[key: string]: any;
@@ -96,8 +96,8 @@ const GridView = React.forwardRef(({ ...rest }: GridViewProps, ref) => {
9696
showThumb={list.Files.length > 0 ? showThumb : mixedType}
9797
file={{
9898
...files[0],
99-
path: "/" + id,
100-
id: `loadingPlaceholder-${pagination.next_token}-${i}`,
99+
path: `${CrUriPrefix}${id}`,
100+
id: id,
101101
first: i == 0,
102102
placeholder: true,
103103
}}

src/component/FileManager/Explorer/ListView/ListBody.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { FmIndexContext } from "../../FmIndexContext.tsx";
66
import { FmFile, loadingPlaceHolderNumb } from "../GridView/GridView.tsx";
77
import { ListViewColumn } from "./Column.tsx";
88
import Row from "./Row.tsx";
9+
import { CrUriPrefix } from "../../../../util/uri.ts";
910

1011
export interface ListBodyProps {
1112
columns: ListViewColumn[];
@@ -34,8 +35,8 @@ const ListBody = ({ columns }: ListBodyProps) => {
3435
const id = `loadingPlaceholder-${pagination.next_token}-${i}`;
3536
list.push({
3637
...files[0],
37-
path: "/" + id,
38-
id: `loadingPlaceholder-${pagination.next_token}-${i}`,
38+
path: `${CrUriPrefix}${id}`,
39+
id: id,
3940
first: i == 0,
4041
placeholder: true,
4142
});

0 commit comments

Comments
 (0)