UNPKG

@mikezimm/fps-core-v7

Version:

Library of reusable core interfaces, types and constants migrated from fps-library-v2

45 lines 1.99 kB
/** * 2024-09-07: Migrated from the same folder in fps-library-v2/banner/features/FPSWebPartClass/functions/... */ import { dcrptMe } from "../../features/Tricky/logfun"; /** * This was moved from BuildBannerPropsX2 to here so the same logic could be used directly in the web part. * Also created IPageContextCopy_15_2User in WebPartContext * @param _trickyEmailsAll * @param user : if user === null then it will compare against FPSUser * @returns */ export function check4Tricks(_trickyEmailsAll, user) { let showTricks = false; const useFPSUser = !user ? true : false; if (useFPSUser === true) user = retrieveFPSUser(); _trickyEmailsAll.map(getsTricks => { /** * Updated logic here to always check for unencrypted emails as well because they may be that way from SULCert * https://github.com/mikezimm/drilldown7/issues/419 */ if (useFPSUser === false && user && user.loginName && user.loginName.toLowerCase().indexOf(dcrptMe(getsTricks)) > -1) { showTricks = true; // Added this so that you can compare against the window.FPSUser } else if (user && user.email && user.email.toLowerCase().indexOf(dcrptMe(getsTricks)) > -1) { showTricks = true; // These 2 else ifs are dups of above only not run through dcrptMe } else if (useFPSUser === false && user && user.loginName && user.loginName.toLowerCase().indexOf(getsTricks) > -1) { showTricks = true; // Added this so that you can compare against the window.FPSUser } else if (user && user.email && user.email.toLowerCase().indexOf(getsTricks) > -1) { showTricks = true; } }); return showTricks; } export function retrieveFPSUser() { const thisWindow = window; const FPSUser = thisWindow.FPSUser; return FPSUser; } //# sourceMappingURL=showTricks.js.map