mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-04 13:20:17 +00: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:
@@ -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(() => {
|
||||
|
||||
Reference in New Issue
Block a user