1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-20 14:37:43 +01:00

Handle nullability of config fields

This commit is contained in:
William Oldham 2024-03-03 18:37:43 +00:00
parent b560445659
commit 404d3b885f
3 changed files with 3 additions and 3 deletions

View file

@ -1,7 +1,7 @@
import { conf } from "@/setup/config";
import { useAuthStore } from "@/stores/auth";
export function useBackendUrl(): string | undefined {
export function useBackendUrl(): string | null {
const backendUrl = useAuthStore((s) => s.backendUrl);
return backendUrl ?? conf().BACKEND_URL;
}

View file

@ -25,7 +25,7 @@ export function TMDBTestPart() {
errorText: "",
});
if (tmdbApiKey.length === 0) {
if (!tmdbApiKey || tmdbApiKey.length === 0) {
return setStatus({
hasTested: true,
success: false,

View file

@ -14,7 +14,7 @@ import { useAuthStore } from "@/stores/auth";
const rem = 16;
function SecureBadge(props: { url: string | undefined }) {
function SecureBadge(props: { url: string | null }) {
const { t } = useTranslation();
const secure = props.url ? props.url.startsWith("https://") : false;
return (