Skip to content
This repository was archived by the owner on Feb 22, 2024. It is now read-only.

Commit dd4fac4

Browse files
remove banner for MLT, MX and virtual accounts of them
1 parent 0327833 commit dd4fac4

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/banners/banners.es6

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ export const isEuCountry = (clients_country, landing_company) => {
2020
: eu_excluded_regex.test(clients_country);
2121
};
2222

23+
export const isMFCountry = (landing_company) => {
24+
const mf_shortcode_regex = new RegExp("^(maltainvest)$");
25+
const gaming_shortcode =
26+
(landing_company && landing_company.gaming_company)
27+
? landing_company.gaming_company.shortcode
28+
: "";
29+
30+
return gaming_shortcode
31+
? mf_shortcode_regex.test(gaming_shortcode)
32+
: false;
33+
}
34+
2335
export const init = () => {
2436
const banner = $($banner).i18n();
2537
const nav = $("body").find("nav");
@@ -33,10 +45,15 @@ const showBanner = () => {
3345
const banner = document.getElementById("close_banner_container");
3446
if (local_storage.get("oauth")) {
3547
liveapi.cached.authorize().then(() => {
48+
const current_loginId = local_storage.get('authorize').loginid;
49+
const getLoginId = loginids().filter( item => item.id === current_loginId);
50+
const is_mf_account = getLoginId[0].is_mf;
51+
const is_virtual = getLoginId[0].is_virtual;
3652
const country = local_storage.get("authorize").country;
3753
liveapi.send({ landing_company: country }).then((data) => {
3854
const landing_company = data.landing_company;
39-
if (isEuCountry(country, landing_company)) {
55+
if (isEuCountry(country, landing_company) &&
56+
(is_mf_account || (isMFCountry(landing_company) && is_virtual))) {
4057
banner.classList.remove("invisible");
4158
} else {
4259
banner.classList.add("invisible");
@@ -64,6 +81,9 @@ liveapi.events.on("login", () => {
6481
liveapi.events.on("logout", () => {
6582
showBanner();
6683
});
84+
liveapi.events.on("switch_account", () => {
85+
showBanner()
86+
});
6787

6888
export default {
6989
init,

src/common/util.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ function loginids() {
384384
is_mlt: /MLT/gi.test(parts.loginid),
385385
is_mx: /MX/gi.test(parts.loginid),
386386
is_cr: /CR/gi.test(parts.loginid),
387+
is_virtual: /VRTC/gi.test(parts.loginid),
387388
};
388389
});
389390
}

0 commit comments

Comments
 (0)