Skip to content

Commit 17079cf

Browse files
committed
check if enableNotification and set it if not
1 parent c0bfaee commit 17079cf

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/components/notification-picker.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { useState, useCallback } from 'react';
1+
import React, { useCallback, useEffect, useState } from 'react';
22

33
import { Cluster } from './cluster';
44
import {
@@ -43,6 +43,18 @@ export function NotificationPicker({
4343
model.notification?.includeOutput || false
4444
);
4545

46+
useEffect(() => {
47+
if (model.notification?.enableNotification === undefined) {
48+
modelChange({
49+
...model,
50+
notification: {
51+
...model.notification,
52+
enableNotification: enableNotification
53+
}
54+
});
55+
}
56+
}, []);
57+
4658
const enableNotificationChange = (e: React.ChangeEvent<HTMLInputElement>) => {
4759
const updatedEnableNotification = e.target.checked;
4860
setEnableNotification(updatedEnableNotification);

0 commit comments

Comments
 (0)