Redirect to /en-US/play if visiting from an unsupported region

This commit is contained in:
redphx 2024-11-01 17:02:30 +07:00
parent e8376b52fe
commit 17c08792e1
2 changed files with 18 additions and 0 deletions

View File

@ -5803,6 +5803,12 @@ var BxExposed = {
} catch (e) { } catch (e) {
BxLogger.error(LOG_TAG3, e); BxLogger.error(LOG_TAG3, e);
} }
try {
let xCloud = state.xcloud.authentication.authStatusByStrategy.XCloud;
if (xCloud.type === 3 && xCloud.error.type === "UnsupportedMarketError") window.stop(), window.location.href = "https://www.xbox.com/en-US/play";
} catch (e) {
BxLogger.error(LOG_TAG3, e);
}
return state; return state;
}, },
modifyTitleInfo: function(titleInfo) { modifyTitleInfo: function(titleInfo) {

View File

@ -63,6 +63,18 @@ export const BxExposed = {
BxLogger.error(LOG_TAG, e); BxLogger.error(LOG_TAG, e);
} }
// Redirect to /en-US/play if visiting from an unsupported region
try {
const xCloud = state.xcloud.authentication.authStatusByStrategy.XCloud;
if (xCloud.type === 3 && xCloud.error.type === 'UnsupportedMarketError') {
// Redirect to /en-US/play
window.stop();
window.location.href = 'https://www.xbox.com/en-US/play';
}
} catch (e) {
BxLogger.error(LOG_TAG, e);
}
return state; return state;
}), }),