mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
fix(ui): restore saved states of quota override checkboxes (#1282)
* fix(ui): restore saved states of quota override checkboxes * fix: check if value is undefined or null, not just truthy Co-authored-by: sct <ryan@sct.dev>
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import { Field, Form, Formik } from 'formik';
|
import { Field, Form, Formik } from 'formik';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import React, { useMemo, useState } from 'react';
|
import React, { useEffect, useMemo, useState } from 'react';
|
||||||
import { defineMessages, useIntl } from 'react-intl';
|
import { defineMessages, useIntl } from 'react-intl';
|
||||||
import { useToasts } from 'react-toast-notifications';
|
import { useToasts } from 'react-toast-notifications';
|
||||||
import useSWR from 'swr';
|
import useSWR from 'swr';
|
||||||
@@ -57,6 +57,15 @@ const UserGeneralSettings: React.FC = () => {
|
|||||||
user ? `/api/v1/user/${user?.id}/settings/main` : null
|
user ? `/api/v1/user/${user?.id}/settings/main` : null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setMovieQuotaEnabled(
|
||||||
|
data?.movieQuotaLimit != undefined && data?.movieQuotaDays != undefined
|
||||||
|
);
|
||||||
|
setTvQuotaEnabled(
|
||||||
|
data?.tvQuotaLimit != undefined && data?.tvQuotaDays != undefined
|
||||||
|
);
|
||||||
|
}, [data]);
|
||||||
|
|
||||||
const { data: languages, error: languagesError } = useSWR<Language[]>(
|
const { data: languages, error: languagesError } = useSWR<Language[]>(
|
||||||
'/api/v1/languages'
|
'/api/v1/languages'
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user