change(ui): add observer
This commit is contained in:
parent
8d7d183041
commit
36be728a54
3 changed files with 7 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import React from 'react';
|
||||
import { Checkbox } from 'UI';
|
||||
import DropdownChips from '../DropdownChips';
|
||||
import { observer } from 'mobx-react-lite'
|
||||
|
||||
interface INotifyHooks {
|
||||
instance: Alert;
|
||||
|
|
@ -128,4 +129,4 @@ function NotifyHooks({
|
|||
);
|
||||
}
|
||||
|
||||
export default NotifyHooks;
|
||||
export default observer(NotifyHooks);
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ const NewAlert = (props: IProps) => {
|
|||
init({});
|
||||
if (list.length === 0) fetchList();
|
||||
fetchTriggerOptions();
|
||||
fetchWebhooks();
|
||||
void fetchWebhooks();
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
|
|||
|
|
@ -71,7 +71,10 @@ export default class AlertsStore {
|
|||
|
||||
edit = (diff: Partial<Alert>) => {
|
||||
const key = Object.keys(diff)[0]
|
||||
const oldInst = this.instance
|
||||
// @ts-ignore
|
||||
this.instance[key] = diff[key]
|
||||
oldInst[key] = diff[key]
|
||||
|
||||
this.instance = oldInst
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue