mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-24 01:18:23 +00:00
Fixes on adding query params in event handler, breaking the app (#7889)
* Fix on version change if left sidebar is open canvas not scrolling right * Fix on adding query params in event handler, breaking the app * Fix
This commit is contained in:
parent
f94b49e180
commit
af24f6ef56
3 changed files with 7 additions and 5 deletions
|
|
@ -256,7 +256,7 @@ const EditorComponent = (props) => {
|
|||
canvasContainerRef.current.scrollLeft += editorMarginLeft;
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [editorMarginLeft]);
|
||||
}, [editorMarginLeft, canvasContainerRef?.current]);
|
||||
|
||||
useEffect(() => {
|
||||
if (mounted) {
|
||||
|
|
|
|||
|
|
@ -6,8 +6,10 @@ import { useTranslation } from 'react-i18next';
|
|||
|
||||
export function GotoApp({ getAllApps, event, handlerChanged, eventIndex, darkMode }) {
|
||||
const queryParamChangeHandler = (index, key, value) => {
|
||||
event.queryParams[index][key] = value;
|
||||
handlerChanged(eventIndex, 'queryParams', event.queryParams);
|
||||
if (event?.queryParams?.[index]?.[key]) {
|
||||
event.queryParams[index][key] = value;
|
||||
handlerChanged(eventIndex, 'queryParams', event.queryParams);
|
||||
}
|
||||
};
|
||||
const { t } = useTranslation();
|
||||
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ export function SwitchPage({ getPages, event, handlerChanged, eventIndex, darkMo
|
|||
<div key={index} className="row input-group mt-1">
|
||||
<div className="col">
|
||||
<CodeHinter
|
||||
initialValue={event.queryParams[index][0]}
|
||||
initialValue={event?.queryParams?.[index]?.[0]}
|
||||
onChange={(value) => queryParamChangeHandler(index, 0, value)}
|
||||
mode="javascript"
|
||||
className="form-control codehinter-query-editor-input"
|
||||
|
|
@ -79,7 +79,7 @@ export function SwitchPage({ getPages, event, handlerChanged, eventIndex, darkMo
|
|||
</div>
|
||||
<div className="col">
|
||||
<CodeHinter
|
||||
initialValue={event.queryParams[index][1]}
|
||||
initialValue={event?.queryParams?.[index]?.[1]}
|
||||
onChange={(value) => queryParamChangeHandler(index, 1, value)}
|
||||
mode="javascript"
|
||||
className="form-control codehinter-query-editor-input"
|
||||
|
|
|
|||
Loading…
Reference in a new issue