UNPKG

@selfcommunity/react-core

Version:

React Core Components useful for integrating UI Community components (react-ui).

21 lines (20 loc) 985 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isWebPushMessagingEnabled = exports.isMobileNativeNotificationEnabled = void 0; const Device_1 = require("../constants/Device"); const utils_1 = require("@selfcommunity/utils"); /** * Check if mobile native push notification is enabled */ function isMobileNativeNotificationEnabled() { return (((0, utils_1.isClientSideRendering)() && window[Device_1.PLATFORM_KEY] && window[Device_1.PLATFORM_KEY] in Device_1.PLATFORM) || (utils_1.LocalStorageDB.checkifSupport() && utils_1.LocalStorageDB.get(Device_1.PLATFORM_KEY) && Device_1.PLATFORMS.includes(utils_1.LocalStorageDB.get(Device_1.PLATFORM_KEY)))); } exports.isMobileNativeNotificationEnabled = isMobileNativeNotificationEnabled; /** * Check if web push messaging is enabled */ function isWebPushMessagingEnabled() { return !isMobileNativeNotificationEnabled(); } exports.isWebPushMessagingEnabled = isWebPushMessagingEnabled;