Skip to content

Commit

Permalink
Fix scene merge dialog (#3466)
Browse files Browse the repository at this point in the history
* Handle bad savedFilterIds
* Fix scene merge dialog
  • Loading branch information
WithoutPants authored Feb 22, 2023
1 parent 87e74d1 commit d0f30eb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
8 changes: 6 additions & 2 deletions ui/v2.5/src/components/FrontPage/FrontPageConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ const ContentRow: React.FC<IFilterRowProps> = (props: IFilterRowProps) => {
case "SavedFilter":
const savedFilter = props.allSavedFilters.find(
(f) =>
f.id === (props.content as ISavedFilterRow).savedFilterId.toString()
f.id ===
(props.content as ISavedFilterRow).savedFilterId?.toString()
);
if (!savedFilter) return "";
return filterTitle(intl, savedFilter);
Expand Down Expand Up @@ -337,7 +338,10 @@ export const FrontPageConfig: React.FC<IFrontPageConfigProps> = ({
}

const existingSavedFilterIDs = currentContent
.filter((f) => f.__typename === "SavedFilter")
.filter(
(f) =>
f.__typename === "SavedFilter" && (f as ISavedFilterRow).savedFilterId
)
.map((f) => (f as ISavedFilterRow).savedFilterId.toString());

function addSavedFilter(content?: FrontPageContent) {
Expand Down
7 changes: 4 additions & 3 deletions ui/v2.5/src/components/Scenes/SceneMergeDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Form, Col, Row, Button, FormControl, Modal } from "react-bootstrap";
import { Form, Col, Row, Button, FormControl } from "react-bootstrap";
import React, { useCallback, useEffect, useMemo, useState } from "react";
import * as GQL from "src/core/generated-graphql";
import { Icon } from "../Shared/Icon";
Expand Down Expand Up @@ -29,6 +29,7 @@ import {
} from "./SceneDetails/SceneScrapeDialog";
import { galleryTitle } from "src/core/galleries";
import { RatingSystem } from "src/components/Shared/Rating/RatingSystem";
import { ModalComponent } from "../Shared/Modal";

interface IStashIDsField {
values: GQL.StashId[];
Expand Down Expand Up @@ -655,7 +656,7 @@ export const SceneMergeModal: React.FC<ISceneMergeModalProps> = ({
}

return (
<Modal
<ModalComponent
show={show}
header={title}
icon={faSignInAlt}
Expand Down Expand Up @@ -723,6 +724,6 @@ export const SceneMergeModal: React.FC<ISceneMergeModalProps> = ({
</Form.Group>
</div>
</div>
</Modal>
</ModalComponent>
);
};

0 comments on commit d0f30eb

Please sign in to comment.