mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-30 10:53:02 +01:00
Refresh automation data shown by edit automation card after update
Previously required the automation page to be refreshed to see updates to the automation in the edit automation card. This would be seen when user tries to edit an automation multiple times (without a page refresh)
This commit is contained in:
parent
f2f37ae444
commit
16b31c3e35
1 changed files with 1 additions and 7 deletions
|
@ -324,7 +324,7 @@ function AutomationsCard(props: AutomationsCardProps) {
|
|||
setNewAutomationData={setUpdatedAutomationData}
|
||||
authenticatedData={props.authenticatedData}
|
||||
isCreating={isEditing}
|
||||
automation={automation}
|
||||
automation={updatedAutomationData || automation}
|
||||
ipLocationData={props.locationData}
|
||||
/>
|
||||
)}
|
||||
|
@ -500,19 +500,14 @@ function EditCard(props: EditCardProps) {
|
|||
);
|
||||
|
||||
let updateQueryUrl = `/api/automation?`;
|
||||
|
||||
updateQueryUrl += `q=${values.queryToRun}`;
|
||||
|
||||
if (automation?.id && !props.createNew) {
|
||||
updateQueryUrl += `&automation_id=${automation.id}`;
|
||||
}
|
||||
|
||||
if (values.subject) {
|
||||
updateQueryUrl += `&subject=${values.subject}`;
|
||||
}
|
||||
|
||||
updateQueryUrl += `&crontime=${cronFrequency}`;
|
||||
|
||||
if (props.locationData) {
|
||||
updateQueryUrl += `&city=${props.locationData.city}`;
|
||||
updateQueryUrl += `®ion=${props.locationData.region}`;
|
||||
|
@ -978,7 +973,6 @@ export default function Automations() {
|
|||
const [suggestedAutomations, setSuggestedAutomations] = useState<AutomationsData[]>([]);
|
||||
const [showLoginPrompt, setShowLoginPrompt] = useState(false);
|
||||
const isMobileWidth = useIsMobileWidth();
|
||||
|
||||
const ipLocationData = useIPLocationData();
|
||||
|
||||
useEffect(() => {
|
||||
|
|
Loading…
Reference in a new issue