From 87a2091bdf975dd68a3de1397ba895292dac97c0 Mon Sep 17 00:00:00 2001 From: jorenn92 Date: Fri, 26 Jan 2024 13:06:07 +0100 Subject: [PATCH] fix(settings): Resolved an issue where updated cron schedules were not visible on the UI until the application was reloaded --- ui/src/components/Settings/Jobs/index.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/src/components/Settings/Jobs/index.tsx b/ui/src/components/Settings/Jobs/index.tsx index 2064bf97..3fc19130 100644 --- a/ui/src/components/Settings/Jobs/index.tsx +++ b/ui/src/components/Settings/Jobs/index.tsx @@ -1,5 +1,5 @@ import { SaveIcon } from '@heroicons/react/solid' -import { useCallback, useContext, useEffect, useRef, useState } from 'react' +import { useContext, useEffect, useRef, useState } from 'react' import SettingsContext from '../../../contexts/settings-context' import { PostApiHandler } from '../../../utils/ApiHandler' import Alert from '../../Common/Alert' @@ -42,6 +42,12 @@ const JobSettings = () => { if (Boolean(resp.code)) { setError(false) setChanged(true) + + // set context values + settingsCtx.settings.rules_handler_job_cron = + payload.rules_handler_job_cron + settingsCtx.settings.collection_handler_job_cron = + payload.collection_handler_job_cron } else { setError(true) setErrorMessage(resp.message.length > 0 ? resp.message : '')