Skip to content

Commit

Permalink
Maryia/Hotfix to show correct notifications (binary-com#4811)
Browse files Browse the repository at this point in the history
* Maryia/Hotfix to show correct notifications

* Maryia/fix for a dev env console error

* Maryia/fix for belgium mlt to not show deriv_go popup

* Maryia/Fix to set notifications on init and then update
  • Loading branch information
maryia-deriv-archive committed Feb 7, 2022
1 parent 6da8873 commit 09c6ed3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
18 changes: 10 additions & 8 deletions packages/core/src/App/Components/Layout/Header/menu-links.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ const MenuLinks = ({ is_logged_in, items }) => (
<React.Fragment>
{!!items.length && (
<div className='header__menu-links'>
{items.map((item, idx) =>
item.login_only && item.login_only !== is_logged_in ? null : (
{items.map((item, idx) => {
const item_text = item.text();

return item.login_only && item.login_only !== is_logged_in ? null : (
<BinaryLink
id={item.id}
key={idx}
Expand All @@ -19,15 +21,15 @@ const MenuLinks = ({ is_logged_in, items }) => (
active_class='header__menu-link--active'
>
<React.Fragment>
{item.text && (
{item_text && (
<Text
size='m'
line_height='xs'
title={item.text()}
title={item_text}
className='header__menu-link-text'
>
{item.icon}
{item.text()}
{item_text}
{item.logo}
</Text>
)}
Expand All @@ -39,8 +41,8 @@ const MenuLinks = ({ is_logged_in, items }) => (
)}
</React.Fragment>
</BinaryLink>
)
)}
);
})}
</div>
)}
</React.Fragment>
Expand All @@ -54,7 +56,7 @@ MenuLinks.propTypes = {
}),
is_logged_in: PropTypes.bool,
link_to: PropTypes.string,
text: PropTypes.function,
text: PropTypes.func,
})
),
};
Expand Down
9 changes: 6 additions & 3 deletions packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -565,11 +565,14 @@ export default class ClientStore extends BaseStore {
@computed
get is_eu() {
if (!this.landing_companies) return false;
const { gaming_company, financial_company } = this.landing_companies;
const { gaming_company, financial_company, mt_gaming_company } = this.landing_companies;
const financial_shortcode = financial_company?.shortcode;
const gaming_shortcode = gaming_company?.shortcode;
return financial_shortcode || gaming_shortcode
? eu_shortcode_regex.test(financial_shortcode) || eu_shortcode_regex.test(gaming_shortcode)
const mt_gaming_shortcode = mt_gaming_company?.financial.shortcode || mt_gaming_company?.swap_free.shortcode;
return financial_shortcode || gaming_shortcode || mt_gaming_shortcode
? eu_shortcode_regex.test(financial_shortcode) ||
eu_shortcode_regex.test(gaming_shortcode) ||
eu_shortcode_regex.test(mt_gaming_shortcode)
: eu_excluded_regex.test(this.residence);
}

Expand Down
10 changes: 10 additions & 0 deletions packages/core/src/Stores/notification-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,16 @@ export default class NotificationStore extends BaseStore {
@action.bound
init() {
this.setClientNotifications();
reaction(
() => [
this.root_store.client.is_uk,
this.root_store.client.has_malta_account,
this.root_store.client.can_have_mlt_account,
],
() => {
this.setClientNotifications();
}
);
}

@action.bound
Expand Down

0 comments on commit 09c6ed3

Please sign in to comment.