Skip to content

Commit

Permalink
[blockly] Fix warning when show code button is clicked twice (#2316)
Browse files Browse the repository at this point in the history
Avoid an error popup when clicking the show code button when already
in code preview mode.

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
  • Loading branch information
jimtng committed Feb 7, 2024
1 parent b49ab25 commit aa79ab2
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ export default {
this.$refs.blocklyEditor.showHideLabels(this.blocklyShowLabels)
},
showBlocklyCode () {
if (this.blocklyCodePreview) return
try {
this.currentModule.configuration.blockSource = this.$refs.blocklyEditor.getBlocks()
this.script = this.$refs.blocklyEditor.getCode()
Expand Down

0 comments on commit aa79ab2

Please sign in to comment.