mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-06 06:48:21 +00:00
hotfix: Edited changes not shown when switching versions (#2386)
* fix edited changes not shown when switching versions * fix version create from not picking editing version * fix version switch not updated on editing version save
This commit is contained in:
parent
124f94ca6b
commit
fa302c0bb0
2 changed files with 19 additions and 1 deletions
|
|
@ -36,6 +36,17 @@ export const AppVersionsManager = function AppVersionsManager({
|
|||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
setEditingAppVersion(editingVersion);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [editingVersion]);
|
||||
|
||||
useEffect(() => {
|
||||
appVersions[appVersions.findIndex((appVersion) => appVersion.id === editingVersion.id)] = editingAppVersion;
|
||||
setCreateAppVersionFrom(editingAppVersion);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [editingAppVersion]);
|
||||
|
||||
const wrapperRef = useRef(null);
|
||||
useEffect(() => {
|
||||
const handleClickOutside = (event) => {
|
||||
|
|
|
|||
|
|
@ -827,7 +827,14 @@ class Editor extends React.Component {
|
|||
} else if (!isEmpty(this.state.editingVersion)) {
|
||||
this.setState({ isSavingEditingVersion: true, showSaveDetail: true });
|
||||
appVersionService.save(this.state.appId, this.state.editingVersion.id, this.state.appDefinition).then(() => {
|
||||
this.setState({ isSavingEditingVersion: false });
|
||||
this.setState({
|
||||
isSavingEditingVersion: false,
|
||||
editingVersion: {
|
||||
...this.state.editingVersion,
|
||||
...{ definition: this.state.appDefinition },
|
||||
},
|
||||
});
|
||||
|
||||
setTimeout(() => this.setState({ showSaveDetail: false }), 3000);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue