From 99ea5d8e2a312edd5bae8dbc400b9677523485cd Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Tue, 12 Apr 2022 12:37:28 -0400 Subject: [PATCH] Chore: TypeScript migration - move `notifications/push` to `lib/notifications` (#3999) * chore: move `notifications/push` to `lib/notifications/push` * update: move `lib/notifications/push` to `lib/notifications` * remove: push.ios.ts --- app/index.tsx | 2 +- app/lib/methods/logout.ts | 2 +- app/{notifications/push => lib/notifications}/index.ts | 4 ++-- app/{notifications/push => lib/notifications}/push.ts | 2 +- app/lib/services/restApi.ts | 2 +- app/sagas/state.js | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) rename app/{notifications/push => lib/notifications}/index.ts (93%) rename app/{notifications/push => lib/notifications}/push.ts (97%) diff --git a/app/index.tsx b/app/index.tsx index 22446d9ce..1dd42188c 100644 --- a/app/index.tsx +++ b/app/index.tsx @@ -11,7 +11,7 @@ import EventEmitter from './utils/events'; import { appInit, appInitLocalSettings, setMasterDetail as setMasterDetailAction } from './actions/app'; import { deepLinkingOpen } from './actions/deepLinking'; import parseQuery from './lib/methods/helpers/parseQuery'; -import { initializePushNotifications, onNotification } from './notifications/push'; +import { initializePushNotifications, onNotification } from './lib/notifications'; import { toggleAnalyticsEventsReport, toggleCrashErrorsReport } from './utils/log'; import { ThemeContext, TSupportedThemes } from './theme'; import { DimensionsContext } from './dimensions'; diff --git a/app/lib/methods/logout.ts b/app/lib/methods/logout.ts index 5a8247ab5..4cd3469b6 100644 --- a/app/lib/methods/logout.ts +++ b/app/lib/methods/logout.ts @@ -2,7 +2,7 @@ import * as FileSystem from 'expo-file-system'; import { Rocketchat as RocketchatClient } from '@rocket.chat/sdk'; import Model from '@nozbe/watermelondb/Model'; -import { getDeviceToken } from '../../notifications/push'; +import { getDeviceToken } from '../notifications'; import { extractHostname } from '../../utils/server'; import { BASIC_AUTH_KEY } from '../../utils/fetch'; import database, { getDatabase } from '../database'; diff --git a/app/notifications/push/index.ts b/app/lib/notifications/index.ts similarity index 93% rename from app/notifications/push/index.ts rename to app/lib/notifications/index.ts index 0928c4199..a0667d278 100644 --- a/app/notifications/push/index.ts +++ b/app/lib/notifications/index.ts @@ -1,8 +1,8 @@ import EJSON from 'ejson'; -import { store } from '../../lib/store/auxStore'; +import { store } from '../store/auxStore'; import { deepLinkingOpen } from '../../actions/deepLinking'; -import { isFDroidBuild } from '../../lib/constants'; +import { isFDroidBuild } from '../constants'; import PushNotification from './push'; import { INotification, SubscriptionType } from '../../definitions'; diff --git a/app/notifications/push/push.ts b/app/lib/notifications/push.ts similarity index 97% rename from app/notifications/push/push.ts rename to app/lib/notifications/push.ts index e4bec45f5..5dadbda82 100644 --- a/app/notifications/push/push.ts +++ b/app/lib/notifications/push.ts @@ -10,7 +10,7 @@ import { import { INotification } from '../../definitions/INotification'; import { isIOS } from '../../utils/deviceInfo'; -import { store as reduxStore } from '../../lib/store/auxStore'; +import { store as reduxStore } from '../store/auxStore'; import I18n from '../../i18n'; class PushNotification { diff --git a/app/lib/services/restApi.ts b/app/lib/services/restApi.ts index 21ee38383..fbf5b862b 100644 --- a/app/lib/services/restApi.ts +++ b/app/lib/services/restApi.ts @@ -14,7 +14,7 @@ import { TEAM_TYPE } from '../../definitions/ITeam'; import { Encryption } from '../encryption'; import { TParams } from '../../definitions/ILivechatEditView'; import { store as reduxStore } from '../store/auxStore'; -import { getDeviceToken } from '../../notifications/push'; +import { getDeviceToken } from '../notifications'; import { getBundleId, isIOS } from '../../utils/deviceInfo'; import roomTypeToApiType, { RoomTypes } from '../methods/roomTypeToApiType'; import sdk from './sdk'; diff --git a/app/sagas/state.js b/app/sagas/state.js index 8f122b4d8..ce85495ea 100644 --- a/app/sagas/state.js +++ b/app/sagas/state.js @@ -1,7 +1,7 @@ import { select, takeLatest } from 'redux-saga/effects'; import RocketChat from '../lib/rocketchat'; -import { setBadgeCount } from '../notifications/push'; +import { setBadgeCount } from '../lib/notifications/push'; import log from '../utils/log'; import { localAuthenticate, saveLastLocalAuthenticationSession } from '../utils/localAuthentication'; import { APP_STATE } from '../actions/actionsTypes';