From e49999bb56adb285a6880ea32a05e62ca316ede2 Mon Sep 17 00:00:00 2001 From: nguyenbavinh-decathlon Date: Wed, 27 Dec 2023 15:11:41 +0700 Subject: [PATCH] Fix issue crash app when edit environment --- packages/bruno-app/src/components/SingleLineEditor/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/bruno-app/src/components/SingleLineEditor/index.js b/packages/bruno-app/src/components/SingleLineEditor/index.js index fb3bff212..5258114a2 100644 --- a/packages/bruno-app/src/components/SingleLineEditor/index.js +++ b/packages/bruno-app/src/components/SingleLineEditor/index.js @@ -122,7 +122,7 @@ class SingleLineEditor extends Component { } }); } - this.editor.setValue(this.props.value || ''); + this.editor.setValue(String(this.props.value) || ''); this.editor.on('change', this._onEdit); this.addOverlay(); } @@ -151,8 +151,8 @@ class SingleLineEditor extends Component { this.editor.setOption('theme', this.props.theme === 'dark' ? 'monokai' : 'default'); } if (this.props.value !== prevProps.value && this.props.value !== this.cachedValue && this.editor) { - this.cachedValue = this.props.value; - this.editor.setValue(this.props.value || ''); + this.cachedValue = String(this.props.value); + this.editor.setValue(String(this.props.value) || ''); } this.ignoreChangeEvent = false; }