Commit b22b57c1 authored by Leon Mok's avatar Leon Mok

Change unneeded lets to consts

parent 91ceadbe
...@@ -24,8 +24,8 @@ const _exportedEvents = [ ...@@ -24,8 +24,8 @@ const _exportedEvents = [
DEVICE_NOTIFICATION_RECEIVED_BACKGROUND_EVENT, DEVICE_NOTIFICATION_RECEIVED_BACKGROUND_EVENT,
DEVICE_NOTIFICATION_OPENED_EVENT DEVICE_NOTIFICATION_OPENED_EVENT
]; ];
let _notificationHandlers = new Map(); const _notificationHandlers = new Map();
let _actionHandlers = new Map(); const _actionHandlers = new Map();
let _actionListener; let _actionListener;
export class NotificationAction { export class NotificationAction {
...@@ -84,18 +84,17 @@ export default class NotificationsIOS { ...@@ -84,18 +84,17 @@ export default class NotificationsIOS {
*/ */
static removeEventListener(type: string, handler: Function) { static removeEventListener(type: string, handler: Function) {
if (_exportedEvents.indexOf(type) !== -1) { if (_exportedEvents.indexOf(type) !== -1) {
let listener = _notificationHandlers.get(handler); const listener = _notificationHandlers.get(handler);
if (!listener) { if (listener) {
return; listener.remove();
_notificationHandlers.delete(handler);
} }
listener.remove();
_notificationHandlers.delete(handler);
} }
} }
static _actionHandlerDispatcher(action: Object) { static _actionHandlerDispatcher(action: Object) {
let actionHandler = _actionHandlers.get(action.identifier); const actionHandler = _actionHandlers.get(action.identifier);
if (actionHandler) { if (actionHandler) {
action.notification = new IOSNotification(action.notification); action.notification = new IOSNotification(action.notification);
...@@ -180,7 +179,7 @@ export default class NotificationsIOS { ...@@ -180,7 +179,7 @@ export default class NotificationsIOS {
* - `fireDate` : The date and time when the system should deliver the notification. if not specified, the notification will be dispatched immediately. * - `fireDate` : The date and time when the system should deliver the notification. if not specified, the notification will be dispatched immediately.
*/ */
static localNotification(notification: Object) { static localNotification(notification: Object) {
let notificationId = uuid.v4(); const notificationId = uuid.v4();
NativeRNNotifications.localNotification(notification, notificationId); NativeRNNotifications.localNotification(notification, notificationId);
return notificationId; return notificationId;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment