mirror of
https://github.com/morpheus65535/bazarr
synced 2024-12-23 16:23:41 +00:00
Fix notifications settings cannot be edited after saved
This commit is contained in:
parent
55399380ad
commit
87c5d0d9de
1 changed files with 11 additions and 1 deletions
|
@ -8,7 +8,13 @@ import {
|
||||||
} from "@/components";
|
} from "@/components";
|
||||||
import { useModalControl, usePayload } from "@/modules/redux/hooks/modal";
|
import { useModalControl, usePayload } from "@/modules/redux/hooks/modal";
|
||||||
import { BuildKey } from "@/utilities";
|
import { BuildKey } from "@/utilities";
|
||||||
import { FunctionComponent, useCallback, useMemo, useState } from "react";
|
import {
|
||||||
|
FunctionComponent,
|
||||||
|
useCallback,
|
||||||
|
useEffect,
|
||||||
|
useMemo,
|
||||||
|
useState,
|
||||||
|
} from "react";
|
||||||
import { Button, Col, Container, Form, Row } from "react-bootstrap";
|
import { Button, Col, Container, Form, Row } from "react-bootstrap";
|
||||||
import { ColCard, useLatestArray, useUpdateArray } from "../components";
|
import { ColCard, useLatestArray, useUpdateArray } from "../components";
|
||||||
import { notificationsKey } from "../keys";
|
import { notificationsKey } from "../keys";
|
||||||
|
@ -43,6 +49,10 @@ const NotificationModal: FunctionComponent<ModalProps & BaseModalProps> = ({
|
||||||
const [current, setCurrent] =
|
const [current, setCurrent] =
|
||||||
useState<Nullable<Settings.NotificationInfo>>(payload);
|
useState<Nullable<Settings.NotificationInfo>>(payload);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setCurrent(payload);
|
||||||
|
}, [payload]);
|
||||||
|
|
||||||
const updateUrl = useCallback((url: string) => {
|
const updateUrl = useCallback((url: string) => {
|
||||||
setCurrent((current) => {
|
setCurrent((current) => {
|
||||||
if (current) {
|
if (current) {
|
||||||
|
|
Loading…
Reference in a new issue