Skip to content

fix: snack bar duplicate #387

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions src/external/bot-skeleton/scratch/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ export const load = async ({
from,
workspace,
showIncompatibleStrategyDialog,
show_snackbar = true,
}) => {
if (!DBotStore?.instance || !workspace) return;
const { setLoading, load_modal } = DBotStore.instance;
Expand All @@ -168,9 +169,8 @@ export const load = async ({
const xmlDoc = new DOMParser().parseFromString(block_string, 'application/xml');
if (xmlDoc.getElementsByTagName('parsererror').length) {
return showInvalidStrategyError();
}
else {
botNotification(notification_message().BOT_IMPORT);
} else {
show_snackbar && botNotification(notification_message().BOT_IMPORT);
}
} catch (e) {
return showInvalidStrategyError();
Expand Down
2 changes: 1 addition & 1 deletion src/stores/load-modal-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ export default class LoadModalStore {
}

const upload_type = getStrategyType(load_options?.block_string ?? '');
const result = await load(load_options);
const result = await load({ ...load_options, show_snackbar: false });
if (!result?.error) {
rudderStackSendUploadStrategyStartEvent({ upload_provider: 'my_computer', upload_id: this.upload_id });
} else if (result?.error) {
Expand Down
Loading