From 9d8e470aa62aefab8a5a78aa2f57f2474f9593db Mon Sep 17 00:00:00 2001 From: Gerard Burns Date: Mon, 22 Jul 2024 09:33:27 +0100 Subject: [PATCH] Fix Screen History Issue (#14207) --- .../builder/src/stores/builder/screens.js | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/packages/builder/src/stores/builder/screens.js b/packages/builder/src/stores/builder/screens.js index b1bef10c36..10c4265e73 100644 --- a/packages/builder/src/stores/builder/screens.js +++ b/packages/builder/src/stores/builder/screens.js @@ -28,11 +28,9 @@ export class ScreenStore extends BudiStore { this.reset = this.reset.bind(this) this.syncAppScreens = this.syncAppScreens.bind(this) this.validate = this.validate.bind(this) - this.save = this.save.bind(this) this.patch = this.patch.bind(this) this.replace = this.replace.bind(this) this.saveScreen = this.saveScreen.bind(this) - this.delete = this.delete.bind(this) this.deleteScreen = this.deleteScreen.bind(this) this.syncScreenData = this.syncScreenData.bind(this) this.updateSetting = this.updateSetting.bind(this) @@ -52,6 +50,9 @@ export class ScreenStore extends BudiStore { } }, }) + + this.delete = this.history.wrapDeleteDoc(this.deleteScreen) + this.save = this.history.wrapSaveDoc(this.saveScreen) } /** @@ -382,25 +383,6 @@ export class ScreenStore extends BudiStore { return null } - /** - * {@link deleteScreen} wrapped to enable history tracking - * @param {object | array} screen - * - */ - async delete(screens_x) { - const wrappedFn = this.history.wrapDeleteDoc(this.deleteScreen) - return wrappedFn(screens_x) - } - - /** - * {@link saveScreen} wrapped to enable history tracking - * @param {object} screen - */ - async save(screen) { - const wrappedFn = this.history.wrapSaveDoc(this.saveScreen) - return wrappedFn(screen) - } - /** * Update a screen by deep setting a property value by name *