Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const DeleteDialog = observer(() => {
const resetStrategiesAfterDelete = async (deleted_strategy_id: string, updated_workspaces: Array<TStrategy>) => {
if (updated_workspaces.length) {
if (selected_strategy_id === deleted_strategy_id) {
await loadStrategyToBuilder(updated_workspaces?.[0]);
await loadStrategyToBuilder(updated_workspaces?.[0], false);
}
// Change preview strategy to the one that was previously previewed
await refreshStrategiesTheme();
Expand Down
4 changes: 3 additions & 1 deletion src/stores/load-modal-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export default class LoadModalStore {
}
};

loadStrategyToBuilder = async (strategy: TStrategy) => {
loadStrategyToBuilder = async (strategy: TStrategy, is_show_notification: boolean = true) => {
if (strategy?.id) {
await load({
block_string: strategy.xml,
Expand All @@ -303,6 +303,7 @@ export default class LoadModalStore {
from: strategy.save_type,
drop_event: {},
showIncompatibleStrategyDialog: false,
show_snackbar: is_show_notification,
});
window.Blockly.derivWorkspace.strategy_to_load = strategy.xml;
}
Expand All @@ -320,6 +321,7 @@ export default class LoadModalStore {
strategy_id: this.selected_strategy?.id,
from: this.selected_strategy?.save_type,
showIncompatibleStrategyDialog: false,
show_snackbar: false,
});
};

Expand Down
Loading