mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 13:45:25 +03:00
Fix paging after submitting
This commit is contained in:
parent
aab1ad4136
commit
cdf9266b05
@ -211,6 +211,7 @@ export default function SubmitPlus() {
|
|||||||
...data.slice(0, pageIndex),
|
...data.slice(0, pageIndex),
|
||||||
[
|
[
|
||||||
...data[pageIndex].slice(0, index),
|
...data[pageIndex].slice(0, index),
|
||||||
|
{ ...data[pageIndex][index], plus_id: "new_upload" },
|
||||||
...data[pageIndex].slice(index + 1),
|
...data[pageIndex].slice(index + 1),
|
||||||
],
|
],
|
||||||
...data.slice(pageIndex + 1),
|
...data.slice(pageIndex + 1),
|
||||||
@ -275,17 +276,14 @@ export default function SubmitPlus() {
|
|||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
|
|
||||||
{events?.map((event, eIdx) => {
|
{events?.map((event) => {
|
||||||
if (event.data.type != "object") {
|
if (event.data.type != "object" || event.plus_id) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const lastRow = eIdx == events.length - 1;
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={event.id}
|
key={event.id}
|
||||||
ref={lastRow ? lastEventRef : null}
|
|
||||||
className="relative flex aspect-video w-full cursor-pointer items-center justify-center rounded-lg bg-black md:rounded-2xl"
|
className="relative flex aspect-video w-full cursor-pointer items-center justify-center rounded-lg bg-black md:rounded-2xl"
|
||||||
onClick={() => setUpload(event)}
|
onClick={() => setUpload(event)}
|
||||||
>
|
>
|
||||||
@ -324,7 +322,7 @@ export default function SubmitPlus() {
|
|||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
|
{!isValidating && !isDone && <div ref={lastEventRef} />}
|
||||||
{isValidating && <ActivityIndicator />}
|
{isValidating && <ActivityIndicator />}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user