react-native-unit-components
Version:
Unit React Native components
37 lines (35 loc) • 1.15 kB
JavaScript
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.injectRefreshEventIfNeeded = exports.getWhiteLabelAppScript = exports.getWhiteLabelAppParams = void 0;
var _bodyScript = require("../../scripts/html/bodyScript");
const getWhiteLabelAppParams = props => {
// customer token is the preferred way to authenticate
if (props.customerToken) {
return `
customer-token="${props.customerToken}"
`;
}
if (props.jwtToken) {
return `
jwt-token="${props.jwtToken}"
`;
}
return '';
};
exports.getWhiteLabelAppParams = getWhiteLabelAppParams;
const injectRefreshEventIfNeeded = (currentWeb, requestRefreshEvent) => {
if (requestRefreshEvent) {
currentWeb?.injectJavaScript(`dispatchRefreshEvent('${JSON.stringify(requestRefreshEvent)}')`);
}
};
exports.injectRefreshEventIfNeeded = injectRefreshEventIfNeeded;
const getWhiteLabelAppScript = () => {
return `
${_bodyScript.DISPATCH_REQUEST_REFRESH}
${_bodyScript.LISTENERS.unitWhiteLabelAppOnLoad}
`;
};
exports.getWhiteLabelAppScript = getWhiteLabelAppScript;
//# sourceMappingURL=UNWhiteLabelAppComponent.utils.js.map
;