Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3400845
D11599.id39012.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D11599.id39012.diff
View Options
diff --git a/lib/actions/alert-actions.js b/lib/actions/alert-actions.js
new file mode 100644
--- /dev/null
+++ b/lib/actions/alert-actions.js
@@ -0,0 +1,5 @@
+// @flow
+
+const recordNotifPermissionAlertActionType = 'RECORD_NOTIF_PERMISSION_ALERT';
+
+export { recordNotifPermissionAlertActionType };
diff --git a/lib/reducers/alert-reducer.js b/lib/reducers/alert-reducer.js
--- a/lib/reducers/alert-reducer.js
+++ b/lib/reducers/alert-reducer.js
@@ -1,8 +1,8 @@
// @flow
+import { recordNotifPermissionAlertActionType } from '../actions/alert-actions.js';
import { alertTypes, type AlertStore } from '../types/alert-types.js';
import type { BaseAction } from '../types/redux-types';
-import { recordNotifPermissionAlertActionType } from '../utils/push-alerts.js';
function reduceAlertStore(state: AlertStore, action: BaseAction): AlertStore {
if (action.type === recordNotifPermissionAlertActionType) {
diff --git a/lib/utils/push-alerts.js b/lib/utils/push-alerts.js
--- a/lib/utils/push-alerts.js
+++ b/lib/utils/push-alerts.js
@@ -2,8 +2,6 @@
import type { AlertInfo } from '../types/alert-types.js';
-const recordNotifPermissionAlertActionType = 'RECORD_NOTIF_PERMISSION_ALERT';
-
const msInDay = 24 * 60 * 60 * 1000;
const shouldSkipPushPermissionAlert = (alertInfo: AlertInfo): boolean =>
(alertInfo.totalAlerts > 3 &&
@@ -13,4 +11,4 @@
(alertInfo.totalAlerts > 9 &&
alertInfo.lastAlertTime > Date.now() - msInDay * 7);
-export { recordNotifPermissionAlertActionType, shouldSkipPushPermissionAlert };
+export { shouldSkipPushPermissionAlert };
diff --git a/native/push/push-handler.react.js b/native/push/push-handler.react.js
--- a/native/push/push-handler.react.js
+++ b/native/push/push-handler.react.js
@@ -6,6 +6,7 @@
import { LogBox, Platform } from 'react-native';
import { Notification as InAppNotification } from 'react-native-in-app-message';
+import { recordNotifPermissionAlertActionType } from 'lib/actions/alert-actions.js';
import type {
DeviceTokens,
SetDeviceTokenActionPayload,
@@ -38,10 +39,7 @@
convertNonPendingIDToNewSchema,
convertNotificationMessageInfoToNewIDSchema,
} from 'lib/utils/migration-utils.js';
-import {
- recordNotifPermissionAlertActionType,
- shouldSkipPushPermissionAlert,
-} from 'lib/utils/push-alerts.js';
+import { shouldSkipPushPermissionAlert } from 'lib/utils/push-alerts.js';
import {
type DispatchActionPromise,
useDispatchActionPromise,
diff --git a/web/push-notif/push-notifs-handler.js b/web/push-notif/push-notifs-handler.js
--- a/web/push-notif/push-notifs-handler.js
+++ b/web/push-notif/push-notifs-handler.js
@@ -2,6 +2,7 @@
import * as React from 'react';
+import { recordNotifPermissionAlertActionType } from 'lib/actions/alert-actions.js';
import {
useSetDeviceTokenFanout,
setDeviceTokenActionTypes,
@@ -13,10 +14,7 @@
import { isDesktopPlatform } from 'lib/types/device-types.js';
import { getConfig } from 'lib/utils/config.js';
import { convertNonPendingIDToNewSchema } from 'lib/utils/migration-utils.js';
-import {
- shouldSkipPushPermissionAlert,
- recordNotifPermissionAlertActionType,
-} from 'lib/utils/push-alerts.js';
+import { shouldSkipPushPermissionAlert } from 'lib/utils/push-alerts.js';
import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js';
import { useDispatch } from 'lib/utils/redux-utils.js';
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 3, 9:09 AM (21 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2611129
Default Alt Text
D11599.id39012.diff (3 KB)
Attached To
Mode
D11599: [lib/native/web] move recordNotifPermissionAlertActionType into seperate actions file
Attached
Detach File
Event Timeline
Log In to Comment