| @@ -1,6 +1,8 @@ | ||
| 1 | +// `pagenow` is only defined inside wp-admin. This module is also reached from | |
| 2 | +// the admin bar bundle, which loads on the front end, so read it defensively. | |
| 1 | 3 | export const isNetworkAdmin = (): boolean => |
| 2 | - window.pagenow.endsWith('-network') | |
| 4 | + true === window.pagenow?.endsWith('-network') | |
| 3 | 5 | |
| 4 | 6 | export const isMacOS = (): boolean => |
| 5 | 7 | null !== /mac/i.exec(window.navigator.userAgent) |
| 6 | 8 | |
| @@ -5,7 +7,10 @@ | ||
| 5 | 7 | null !== /mac/i.exec(window.navigator.userAgent) |
| 6 | 8 | |
| 7 | 9 | export const isLicensed = (): boolean => |
| 8 | 10 | !!window.CODE_SNIPPETS?.isLicensed |
| 11 | + | |
| 12 | +export const isCloudConnected = (): boolean => | |
| 13 | + !!window.CODE_SNIPPETS?.isCloudConnected | |
| 9 | 14 | |
| 10 | 15 | export const shouldShowUpsell = () => |
| 11 | 16 | !isLicensed() && !window.CODE_SNIPPETS?.hideUpsell |