summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLASER-Yi <[email protected]>2022-03-26 22:24:36 +0800
committerLASER-Yi <[email protected]>2022-03-26 22:24:36 +0800
commit87c5d0d9defdc3f01865eeb844dfe191934411fb (patch)
tree39376dd70f5287d434d158c7637242126f3cc06f
parent55399380ada67fae9b98a5ea9884aea08e475e7e (diff)
downloadbazarr-87c5d0d9defdc3f01865eeb844dfe191934411fb.tar.gz
bazarr-87c5d0d9defdc3f01865eeb844dfe191934411fb.zip
Fix notifications settings cannot be edited after savedv1.0.4-beta.16
-rw-r--r--frontend/src/pages/Settings/Notifications/components.tsx12
1 files changed, 11 insertions, 1 deletions
diff --git a/frontend/src/pages/Settings/Notifications/components.tsx b/frontend/src/pages/Settings/Notifications/components.tsx
index 5b8ed2007..f53ab7132 100644
--- a/frontend/src/pages/Settings/Notifications/components.tsx
+++ b/frontend/src/pages/Settings/Notifications/components.tsx
@@ -8,7 +8,13 @@ import {
} from "@/components";
import { useModalControl, usePayload } from "@/modules/redux/hooks/modal";
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 { ColCard, useLatestArray, useUpdateArray } from "../components";
import { notificationsKey } from "../keys";
@@ -43,6 +49,10 @@ const NotificationModal: FunctionComponent<ModalProps & BaseModalProps> = ({
const [current, setCurrent] =
useState<Nullable<Settings.NotificationInfo>>(payload);
+ useEffect(() => {
+ setCurrent(payload);
+ }, [payload]);
+
const updateUrl = useCallback((url: string) => {
setCurrent((current) => {
if (current) {