Compare commits
2 Commits
ba1b5bb965
...
0e8f63101c
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e8f63101c | |||
| 4e2cad790b |
@@ -4,6 +4,7 @@ import { convert } from "html-to-text";
|
|||||||
import ellipsize from "ellipsize";
|
import ellipsize from "ellipsize";
|
||||||
import { LIBRARY_SERVICE_BASE_URI } from "../../constants/endpoints";
|
import { LIBRARY_SERVICE_BASE_URI } from "../../constants/endpoints";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { useGetComicByIdQuery } from "../../graphql/generated";
|
||||||
|
|
||||||
interface MatchResultProps {
|
interface MatchResultProps {
|
||||||
matchData: any;
|
matchData: any;
|
||||||
@@ -31,7 +32,7 @@ export const MatchResult = (props: MatchResultProps) => {
|
|||||||
// Invalidate and refetch the comic book metadata
|
// Invalidate and refetch the comic book metadata
|
||||||
if (props.queryClient) {
|
if (props.queryClient) {
|
||||||
await props.queryClient.invalidateQueries({
|
await props.queryClient.invalidateQueries({
|
||||||
queryKey: ["comicBookMetadata", comicObjectId],
|
queryKey: useGetComicByIdQuery.getKey({ id: comicObjectId }),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ interface LibraryStatisticsProps {
|
|||||||
* Returns `null` when `stats` is absent or the statistics array is empty.
|
* Returns `null` when `stats` is absent or the statistics array is empty.
|
||||||
*/
|
*/
|
||||||
export const LibraryStatistics = ({ stats }: LibraryStatisticsProps): ReactElement | null => {
|
export const LibraryStatistics = ({ stats }: LibraryStatisticsProps): ReactElement | null => {
|
||||||
if (!stats) return null;
|
if (!stats || !stats.totalDocuments) return null;
|
||||||
|
|
||||||
const facet = stats.statistics?.[0];
|
const facet = stats.statistics?.[0];
|
||||||
if (!facet) return null;
|
if (!facet) return null;
|
||||||
|
|||||||
@@ -11,9 +11,11 @@ type VolumeGroupsProps = {
|
|||||||
volumeGroups?: GetVolumeGroupsQuery['getComicBookGroups'];
|
volumeGroups?: GetVolumeGroupsQuery['getComicBookGroups'];
|
||||||
};
|
};
|
||||||
|
|
||||||
export const VolumeGroups = (props: VolumeGroupsProps): ReactElement => {
|
export const VolumeGroups = (props: VolumeGroupsProps): ReactElement | null => {
|
||||||
// Till mongo gives us back the deduplicated results with the ObjectId
|
// Till mongo gives us back the deduplicated results with the ObjectId
|
||||||
const deduplicatedGroups = unionBy(props.volumeGroups, "volumes.id");
|
const deduplicatedGroups = unionBy(props.volumeGroups, "volumes.id");
|
||||||
|
if (!deduplicatedGroups || deduplicatedGroups.length === 0) return null;
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const navigateToVolumes = (row: any) => {
|
const navigateToVolumes = (row: any) => {
|
||||||
navigate(`/volumes/all`);
|
navigate(`/volumes/all`);
|
||||||
|
|||||||
@@ -15,7 +15,9 @@ type WantedComicsListProps = {
|
|||||||
|
|
||||||
export const WantedComicsList = ({
|
export const WantedComicsList = ({
|
||||||
comics,
|
comics,
|
||||||
}: WantedComicsListProps): ReactElement => {
|
}: WantedComicsListProps): ReactElement | null => {
|
||||||
|
if (!comics || comics.length === 0) return null;
|
||||||
|
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|
||||||
// embla carousel
|
// embla carousel
|
||||||
|
|||||||
Reference in New Issue
Block a user