async function onStackModified() {
		const bOnlySwitchVersion = !this.getShowToolbars() || !this.getCommandStack().canUndo();
		try {
			// warn the user: the existing draft would be discarded in case the user saves
			const bDiscardDraft = await Utils.checkDraftOverwrite(this._oVersionsModel, bOnlySwitchVersion);
			if (bDiscardDraft) {
				await VersionsAPI.discardDraft({
					layer: this.getLayer(),
					control: this.getRootControlInstance(),
					updateState: true,
					discardDraftAndKeepActiveVersion: true
				});
			}
			if (this.getShowToolbars()) {
				const oCommandStack = this.getCommandStack();
				const bCanUndo = oCommandStack.canUndo();
				const bCanRedo = oCommandStack.canRedo();
				const bCanSave = oCommandStack.canSave();
				const bWasSaved = oCommandStack.getSaved();
				const bTranslationRelevantDirtyChange = this._oToolbarControlsModel.getProperty("/translation/visible") &&
					TranslationAPI.hasTranslationRelevantDirtyChanges({layer: Layer.CUSTOMER, selector: this.getRootControlInstance()});

				// TODO: move to the setter to the ChangesState
				this._oVersionsModel.setDirtyChanges(PersistenceWriteAPI.hasDirtyChanges({selector: this.getRootControlInstance()}));
				this._oToolbarControlsModel.setProperty("/undo/enabled", bCanUndo);
				this._oToolbarControlsModel.setProperty("/redo/enabled", bCanRedo);
				this._oToolbarControlsModel.setProperty("/save/enabled", bCanSave);
				this._oToolbarControlsModel.setProperty("/restore/enabled", this.bInitialResetEnabled || bCanSave || bWasSaved);
				this._oToolbarControlsModel.setProperty(
					"/translation/enabled",
					this.bPersistedDataTranslatable || bTranslationRelevantDirtyChange
				);
				const bChangesNeedHardReload = this._bSavedChangesNeedReload || await this._oSerializer.needsReload();
				this._oToolbarControlsModel.setProperty("/changesNeedHardReload", bChangesNeedHardReload);
			}
			this.fireUndoRedoStackModified();
		} catch (e) {
			this.undo();
		}
	}
Adapt the enablement of undo/redo/reset button