Skip to content

Commit

Permalink
fix: call the open load strategy event from config
Browse files Browse the repository at this point in the history
  • Loading branch information
farabi-deriv committed Oct 16, 2024
1 parent 114920c commit d4b1ed7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,6 @@ const Announcements = observer(({ is_mobile, is_tablet, handleTabChange }: TAnno
announcement_name: selected_announcement?.announcement.main_title,
announcement_action: selected_announcement?.announcement.confirm_button_text,
});
if (selected_announcement?.announcement.confirm_button_text === 'Import strategy') {
rudderStackSendOpenEvent({
subpage_name: 'bot_builder',
subform_source: 'announcements',
subform_name: 'load_strategy',
load_strategy_tab: 'recent',
});
}
if (selected_announcement?.switch_tab_on_confirm) {
handleTabChange(selected_announcement.switch_tab_on_confirm);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import { OpenLiveChatLink } from '@deriv/components';
import { Localize, localize } from '@deriv/translations';
import { DBOT_TABS } from 'Constants/bot-contents';
import { rudderStackSendOpenEvent } from '../../../analytics/rudderstack-common-events';
import { handleOnConfirmAccumulator } from './utils/accumulator-helper-functions';
import { IconAnnounce } from './announcement-components';

Expand Down Expand Up @@ -75,6 +76,14 @@ export const ANNOUNCEMENTS: Record<string, TAnnouncement> = {
should_not_be_cancel: true,
should_toggle_modal: true,
switch_tab_on_confirm: DBOT_TABS.BOT_BUILDER,
onConfirm: () => {
rudderStackSendOpenEvent({
subpage_name: 'bot_builder',
subform_source: 'announcements',
subform_name: 'load_strategy',
load_strategy_tab: 'recent',
});
},
},

BLOCKLY_ANNOUNCE: {
Expand Down

0 comments on commit d4b1ed7

Please sign in to comment.