Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/botPage/view/blockly/blocks/trade/tradeOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ export default () => {
const tradeType = getTradeType(this);

const prevSelectedDuration = durationTypeList.getValue();

Blockly.Events.recordUndo = false;
this.setFieldValue(translate('Loading...'), 'DURATIONTYPE_LIST');
Blockly.Events.recordUndo = true;

getAvailableDurations(symbol, tradeType).then(durations => {
Blockly.Events.recordUndo = false;
// Prevent UI flickering by only updating field if options have changed
// eslint-disable-next-line no-underscore-dangle
if (JSON.stringify(durationTypeList.menuGenerator_) !== JSON.stringify(durations)) {
Expand All @@ -56,6 +60,7 @@ export default () => {
} else {
this.setFieldValue(translate('Not available'), 'DURATIONTYPE_LIST');
}
Blockly.Events.recordUndo = true;
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/botPage/view/blockly/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,11 @@ export default class _Blockly {
this.blocksXmlStr = Blockly.Xml.domToPrettyText(main);
Blockly.Xml.domToWorkspace(main.getElementsByTagName('xml')[0], workspace);
this.zoomOnPlusMinus();
Blockly.mainWorkspace.clearUndo();
disposeBlocksWithLoaders();
setTimeout(() => {
setBeforeUnload(true);
Blockly.mainWorkspace.cleanUp();
Blockly.mainWorkspace.clearUndo();
}, 0);
resolve();
});
Expand Down