diff --git a/src/renderer/components/modal/modal-types/models/download-models-modal.component.tsx b/src/renderer/components/modal/modal-types/models/download-models-modal.component.tsx index 3e51d4a7..ac5a174f 100644 --- a/src/renderer/components/modal/modal-types/models/download-models-modal.component.tsx +++ b/src/renderer/components/modal/modal-types/models/download-models-modal.component.tsx @@ -20,6 +20,10 @@ import { useConstant } from "renderer/hooks/use-constant.hook"; import { MODEL_TYPES, MS_GET_QUERY_SORTS } from "shared/models/models/constants"; import { useOnUpdate } from "renderer/hooks/use-on-update.hook"; import equal from "fast-deep-equal"; +import { catchError, of } from "rxjs"; +import { BsmIcon } from "renderer/components/svgs/bsm-icon.component"; +import Tippy from "@tippyjs/react"; +import { useThemeColor } from "renderer/hooks/use-theme-color.hook"; export const DownloadModelsModal: ModalComponent = ({resolver, data: { version, type }}) => { @@ -38,9 +42,11 @@ export const DownloadModelsModal: ModalComponent([]); const isOnline = useObservable(os.isOnline$, true); + const [error, error$] = useBehaviorSubject(false); const [isLoading, isLoading$] = useBehaviorSubject(false); console.log(msModels); @@ -51,7 +57,11 @@ export const DownloadModelsModal: ModalComponent({ type: currentType, platform: MSModelPlatform.PC, start: 0, end: 25, sort: currentSort, sortDirection: MSGetSortDirection.Descending }); useOnUpdate(() => { - const sub = modelSaber.searchModels(getQuery).subscribe(models => msModels$.next([...msModels, ...models])); + error$.next(false); + const sub = modelSaber.searchModels(getQuery).pipe(catchError(() => { + error$.next(true); + return of([]); + })).subscribe(models => msModels$.next([...msModels, ...models])); return () => sub.unsubscribe(); }, [getQuery]) @@ -97,13 +107,36 @@ export const DownloadModelsModal: ModalComponent { modelsDownloader.addModelToDownload({...model, version}); }, []); - + + const filterTipsHTML = useConstant(() => ( +
+ + + + + + + + + + +
TagDescription
author:Only show models by the specified author.
hash:Only show models with the specified hash.
tag:Only show models with the specified tag.
name:Only show models with the specified name.
discordid:Only show models by the user with the specified discordid.
status:Only show models with the specified approval status. (profile only, and only for the author)
+
+ )) return (
{e.preventDefault(); search()}}>
currentType$.next(value)}/> - searhInput$.next(e.target.value)}/> +
+ searhInput$.next(e.target.value)}/> + +
+ +
+
+ +
{e.preventDefault(); search()}}/> currentSort$.next(value)}/>