Chore: Evaluate helpers and methods - Typescript (#4030)
* move userPreferences to methods folder * create formatAttachmentUrl file * create compareServerVersion file * create generateLoadMoreId file
This commit is contained in:
parent
9a11fb2797
commit
7d2ae5ea7c
|
@ -10,7 +10,7 @@ import { TYPE } from './constants';
|
|||
import { ATTEMPTS_KEY, LOCKED_OUT_TIMER_KEY, MAX_ATTEMPTS, PASSCODE_KEY } from '../../constants/localAuthentication';
|
||||
import { biometryAuth, resetAttempts } from '../../utils/localAuthentication';
|
||||
import { getDiff, getLockedUntil } from './utils';
|
||||
import { useUserPreferences } from '../../lib/userPreferences';
|
||||
import { useUserPreferences } from '../../lib/methods/userPreferences';
|
||||
import I18n from '../../i18n';
|
||||
|
||||
interface IPasscodePasscodeEnter {
|
||||
|
|
|
@ -8,12 +8,12 @@ import * as Progress from 'react-native-progress';
|
|||
import Touchable from './Touchable';
|
||||
import Markdown from '../markdown';
|
||||
import styles from './styles';
|
||||
import { formatAttachmentUrl } from '../../lib/utils';
|
||||
import { themes } from '../../constants/colors';
|
||||
import MessageContext from './Context';
|
||||
import { TGetCustomEmoji } from '../../definitions/IEmoji';
|
||||
import { IAttachment } from '../../definitions';
|
||||
import { useTheme } from '../../theme';
|
||||
import { formatAttachmentUrl } from '../../lib/methods/helpers/formatAttachmentUrl';
|
||||
|
||||
interface IMessageButton {
|
||||
children: React.ReactElement;
|
||||
|
|
|
@ -11,12 +11,12 @@ import sharedStyles from '../../views/Styles';
|
|||
import { themes } from '../../constants/colors';
|
||||
import MessageContext from './Context';
|
||||
import { fileDownloadAndPreview } from '../../utils/fileDownload';
|
||||
import { formatAttachmentUrl } from '../../lib/utils';
|
||||
import { IAttachment } from '../../definitions/IAttachment';
|
||||
import { TGetCustomEmoji } from '../../definitions/IEmoji';
|
||||
import RCActivityIndicator from '../ActivityIndicator';
|
||||
import Attachments from './Attachments';
|
||||
import { useTheme } from '../../theme';
|
||||
import { formatAttachmentUrl } from '../../lib/methods/helpers/formatAttachmentUrl';
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
button: {
|
||||
|
|
|
@ -6,7 +6,6 @@ import Touchable from './Touchable';
|
|||
import Markdown from '../markdown';
|
||||
import { isIOS } from '../../utils/deviceInfo';
|
||||
import { CustomIcon } from '../../lib/Icons';
|
||||
import { formatAttachmentUrl } from '../../lib/utils';
|
||||
import { themes } from '../../constants/colors';
|
||||
import MessageContext from './Context';
|
||||
import { fileDownload } from '../../utils/fileDownload';
|
||||
|
@ -17,6 +16,7 @@ import { IAttachment } from '../../definitions/IAttachment';
|
|||
import RCActivityIndicator from '../ActivityIndicator';
|
||||
import { TGetCustomEmoji } from '../../definitions/IEmoji';
|
||||
import { useTheme } from '../../theme';
|
||||
import { formatAttachmentUrl } from '../../lib/methods/helpers/formatAttachmentUrl';
|
||||
|
||||
const SUPPORTED_TYPES = ['video/quicktime', 'video/mp4', ...(isIOS ? [] : ['video/3gp', 'video/mkv'])];
|
||||
const isTypeSupported = (type: string) => SUPPORTED_TYPES.indexOf(type) !== -1;
|
||||
|
|
|
@ -4,7 +4,7 @@ import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
|||
import { Q, Model } from '@nozbe/watermelondb';
|
||||
|
||||
import RocketChat from '../rocketchat';
|
||||
import UserPreferences from '../userPreferences';
|
||||
import UserPreferences from '../methods/userPreferences';
|
||||
import database from '../database';
|
||||
import protectedFunction from '../methods/helpers/protectedFunction';
|
||||
import Deferred from '../../utils/deferred';
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
import { coerce, gt, gte, lt, lte, SemVer } from 'semver';
|
||||
|
||||
const methods = {
|
||||
lowerThan: lt,
|
||||
lowerThanOrEqualTo: lte,
|
||||
greaterThan: gt,
|
||||
greaterThanOrEqualTo: gte
|
||||
};
|
||||
|
||||
export const compareServerVersion = (
|
||||
currentServerVersion: string | null | undefined,
|
||||
method: keyof typeof methods,
|
||||
versionToCompare: string
|
||||
): boolean =>
|
||||
(currentServerVersion && methods[method](coerce(currentServerVersion) as string | SemVer, versionToCompare)) as boolean;
|
|
@ -0,0 +1,9 @@
|
|||
export const formatAttachmentUrl = (attachmentUrl: string | undefined, userId: string, token: string, server: string): string => {
|
||||
if (attachmentUrl && attachmentUrl.startsWith('http')) {
|
||||
if (attachmentUrl.includes('rc_token')) {
|
||||
return encodeURI(attachmentUrl);
|
||||
}
|
||||
return encodeURI(`${attachmentUrl}?rc_uid=${userId}&rc_token=${token}`);
|
||||
}
|
||||
return encodeURI(`${server}${attachmentUrl}?rc_uid=${userId}&rc_token=${token}`);
|
||||
};
|
|
@ -0,0 +1 @@
|
|||
export const generateLoadMoreId = (id: string): string => `load-more-${id}`;
|
|
@ -2,10 +2,10 @@ import EJSON from 'ejson';
|
|||
|
||||
import { Encryption } from '../../encryption';
|
||||
import { store as reduxStore } from '../../auxStore';
|
||||
import { compareServerVersion } from '../../utils';
|
||||
import findSubscriptionsRooms from './findSubscriptionsRooms';
|
||||
import normalizeMessage from './normalizeMessage';
|
||||
import { ISubscription, IServerSubscription, IServerRoom, IRoom } from '../../../definitions';
|
||||
import { compareServerVersion } from './compareServerVersion';
|
||||
|
||||
export const merge = (subscription: ISubscription | IServerSubscription, room?: IRoom | IServerRoom): ISubscription => {
|
||||
const serverVersion = reduxStore.getState().server.version as string;
|
||||
|
|
|
@ -6,8 +6,8 @@ import log from '../../utils/log';
|
|||
import { getMessageById } from '../database/services/Message';
|
||||
import roomTypeToApiType, { RoomTypes } from './roomTypeToApiType';
|
||||
import sdk from '../rocketchat/services/sdk';
|
||||
import { generateLoadMoreId } from '../utils';
|
||||
import updateMessages from './updateMessages';
|
||||
import { generateLoadMoreId } from './helpers/generateLoadMoreId';
|
||||
|
||||
const COUNT = 50;
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@ import orderBy from 'lodash/orderBy';
|
|||
import log from '../../utils/log';
|
||||
import { getMessageById } from '../database/services/Message';
|
||||
import { MessageTypeLoad } from '../../constants/messageTypeLoad';
|
||||
import { generateLoadMoreId } from '../utils';
|
||||
import updateMessages from './updateMessages';
|
||||
import { TMessageModel } from '../../definitions';
|
||||
import sdk from '../rocketchat/services/sdk';
|
||||
import { generateLoadMoreId } from './helpers/generateLoadMoreId';
|
||||
|
||||
const COUNT = 50;
|
||||
|
||||
|
|
|
@ -7,8 +7,8 @@ import { getMessageById } from '../database/services/Message';
|
|||
import { MessageTypeLoad } from '../../constants/messageTypeLoad';
|
||||
import sdk from '../rocketchat/services/sdk';
|
||||
import { IMessage } from '../../definitions';
|
||||
import { generateLoadMoreId } from '../utils';
|
||||
import updateMessages from './updateMessages';
|
||||
import { generateLoadMoreId } from './helpers/generateLoadMoreId';
|
||||
|
||||
const COUNT = 50;
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@ import { IMessage, TMessageModel, TSubscriptionModel, TThreadMessageModel, TThre
|
|||
import database from '../database';
|
||||
import { getSubscriptionByRoomId } from '../database/services/Subscription';
|
||||
import { Encryption } from '../encryption';
|
||||
import { generateLoadMoreId } from '../utils';
|
||||
import buildMessage from './helpers/buildMessage';
|
||||
import { generateLoadMoreId } from './helpers/generateLoadMoreId';
|
||||
import protectedFunction from './helpers/protectedFunction';
|
||||
|
||||
interface IUpdateMessages {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import sdk from '../services/sdk';
|
||||
import { compareServerVersion } from '../../utils';
|
||||
import { store as reduxStore } from '../../auxStore';
|
||||
import database from '../../database';
|
||||
import log from '../../../utils/log';
|
||||
import { clearEnterpriseModules, setEnterpriseModules as setEnterpriseModulesAction } from '../../../actions/enterpriseModules';
|
||||
import { compareServerVersion } from '../../methods/helpers/compareServerVersion';
|
||||
|
||||
const LICENSE_OMNICHANNEL_MOBILE_ENTERPRISE = 'omnichannel-mobile-enterprise';
|
||||
const LICENSE_LIVECHAT_ENTERPRISE = 'livechat-enterprise';
|
||||
|
|
|
@ -2,13 +2,13 @@ import orderBy from 'lodash/orderBy';
|
|||
import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
||||
|
||||
import { ICustomEmojis } from '../../../reducers/customEmojis';
|
||||
import { compareServerVersion } from '../../utils';
|
||||
import { store as reduxStore } from '../../auxStore';
|
||||
import database from '../../database';
|
||||
import log from '../../../utils/log';
|
||||
import { setCustomEmojis as setCustomEmojisAction } from '../../../actions/customEmojis';
|
||||
import { ICustomEmoji, TCustomEmojiModel } from '../../../definitions';
|
||||
import sdk from '../services/sdk';
|
||||
import { compareServerVersion } from '../../methods/helpers/compareServerVersion';
|
||||
|
||||
interface IUpdateEmojis {
|
||||
update: TCustomEmojiModel[];
|
||||
|
|
|
@ -8,8 +8,8 @@ import log from '../../../utils/log';
|
|||
import { store as reduxStore } from '../../auxStore';
|
||||
import database from '../../database';
|
||||
import sdk from '../services/sdk';
|
||||
import { compareServerVersion } from '../../utils';
|
||||
import protectedFunction from '../../methods/helpers/protectedFunction';
|
||||
import { compareServerVersion } from '../../methods/helpers/compareServerVersion';
|
||||
|
||||
export const SUPPORTED_PERMISSIONS = [
|
||||
'add-user-to-any-c-room',
|
||||
|
|
|
@ -2,13 +2,13 @@ import { InteractionManager } from 'react-native';
|
|||
import { sanitizedRaw } from '@nozbe/watermelondb/RawRecord';
|
||||
|
||||
import { IActiveUsers } from '../../../reducers/activeUsers';
|
||||
import { compareServerVersion } from '../../utils';
|
||||
import { store as reduxStore } from '../../auxStore';
|
||||
import { setActiveUsers } from '../../../actions/activeUsers';
|
||||
import { setUser } from '../../../actions/login';
|
||||
import database from '../../database';
|
||||
import { IRocketChat, IUser } from '../../../definitions';
|
||||
import sdk from '../services/sdk';
|
||||
import { compareServerVersion } from '../../methods/helpers/compareServerVersion';
|
||||
|
||||
export function subscribeUsersPresence(this: IRocketChat) {
|
||||
const serverVersion = reduxStore.getState().server.version as string;
|
||||
|
|
|
@ -10,7 +10,7 @@ import RocketChat from '..';
|
|||
import { useSsl } from '../../../utils/url';
|
||||
import log from '../../../utils/log';
|
||||
import { E2E_PRIVATE_KEY, E2E_PUBLIC_KEY, E2E_RANDOM_PASSWORD_KEY } from '../../constants';
|
||||
import UserPreferences from '../../userPreferences';
|
||||
import UserPreferences from '../../methods/userPreferences';
|
||||
import { ICertificate, IRocketChat } from '../../../definitions';
|
||||
import sdk from '../services/sdk';
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import { InteractionManager } from 'react-native';
|
|||
import { setActiveUsers } from '../../../actions/activeUsers';
|
||||
import { setUser } from '../../../actions/login';
|
||||
import { store as reduxStore } from '../../auxStore';
|
||||
import { compareServerVersion } from '../../utils';
|
||||
import { compareServerVersion } from '../../methods/helpers/compareServerVersion';
|
||||
|
||||
// TODO
|
||||
export function _setUser(this: any, ddpMessage: { fields: any; id: any; cleared: any }) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { IPreferences } from '../../../definitions';
|
||||
import userPreferences from '../../userPreferences';
|
||||
import userPreferences from '../../methods/userPreferences';
|
||||
|
||||
const SORT_PREFS_KEY = 'RC_SORT_PREFS_KEY';
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ import protectedFunction from '../../methods/helpers/protectedFunction';
|
|||
import database from '../../database';
|
||||
import { selectServerFailure } from '../../../actions/server';
|
||||
import { twoFactor } from '../../../utils/twoFactor';
|
||||
import { compareServerVersion } from '../../utils';
|
||||
import { store } from '../../auxStore';
|
||||
import { loginRequest, setLoginServices, setUser } from '../../../actions/login';
|
||||
import sdk from './sdk';
|
||||
|
@ -25,6 +24,7 @@ import EventEmitter from '../../../utils/events';
|
|||
import { updateSettings } from '../../../actions/settings';
|
||||
import defaultSettings from '../../../constants/settings';
|
||||
import { MIN_ROCKETCHAT_VERSION } from '../../constants';
|
||||
import { compareServerVersion } from '../../methods/helpers/compareServerVersion';
|
||||
|
||||
interface IServices {
|
||||
[index: string]: string | boolean;
|
||||
|
|
|
@ -16,9 +16,9 @@ import { TParams } from '../../../definitions/ILivechatEditView';
|
|||
import { store as reduxStore } from '../../auxStore';
|
||||
import { getDeviceToken } from '../../../notifications/push';
|
||||
import { getBundleId, isIOS } from '../../../utils/deviceInfo';
|
||||
import { compareServerVersion } from '../../utils';
|
||||
import roomTypeToApiType, { RoomTypes } from '../../methods/roomTypeToApiType';
|
||||
import sdk from './sdk';
|
||||
import { compareServerVersion } from '../../methods/helpers/compareServerVersion';
|
||||
|
||||
export const createChannel = ({
|
||||
name,
|
||||
|
|
|
@ -4,7 +4,7 @@ import { shareSetSettings, shareSelectServer, shareSetUser } from '../../../acti
|
|||
import SSLPinning from '../../../utils/sslPinning';
|
||||
import log from '../../../utils/log';
|
||||
import { IShareServer, IShareUser } from '../../../reducers/share';
|
||||
import UserPreferences from '../../userPreferences';
|
||||
import UserPreferences from '../../methods/userPreferences';
|
||||
import database from '../../database';
|
||||
import RocketChat from '..';
|
||||
import { encryptionInit } from '../../../actions/encryption';
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
import { coerce, gt, gte, lt, lte, SemVer } from 'semver';
|
||||
|
||||
export const formatAttachmentUrl = (attachmentUrl: string | undefined, userId: string, token: string, server: string): string => {
|
||||
if (attachmentUrl && attachmentUrl.startsWith('http')) {
|
||||
if (attachmentUrl.includes('rc_token')) {
|
||||
return encodeURI(attachmentUrl);
|
||||
}
|
||||
return encodeURI(`${attachmentUrl}?rc_uid=${userId}&rc_token=${token}`);
|
||||
}
|
||||
return encodeURI(`${server}${attachmentUrl}?rc_uid=${userId}&rc_token=${token}`);
|
||||
};
|
||||
|
||||
const methods = {
|
||||
lowerThan: lt,
|
||||
lowerThanOrEqualTo: lte,
|
||||
greaterThan: gt,
|
||||
greaterThanOrEqualTo: gte
|
||||
};
|
||||
|
||||
export const compareServerVersion = (
|
||||
currentServerVersion: string | null | undefined,
|
||||
method: keyof typeof methods,
|
||||
versionToCompare: string
|
||||
): boolean =>
|
||||
(currentServerVersion && methods[method](coerce(currentServerVersion) as string | SemVer, versionToCompare)) as boolean;
|
||||
|
||||
export const generateLoadMoreId = (id: string): string => `load-more-${id}`;
|
|
@ -1,6 +1,6 @@
|
|||
import { all, delay, put, select, take, takeLatest } from 'redux-saga/effects';
|
||||
|
||||
import UserPreferences from '../lib/userPreferences';
|
||||
import UserPreferences from '../lib/methods/userPreferences';
|
||||
import Navigation from '../lib/Navigation';
|
||||
import * as types from '../actions/actionsTypes';
|
||||
import { selectServerRequest, serverInitAdd } from '../actions/server';
|
||||
|
|
|
@ -8,7 +8,7 @@ import Navigation from '../lib/Navigation';
|
|||
import { E2E_BANNER_TYPE, E2E_PRIVATE_KEY, E2E_PUBLIC_KEY, E2E_RANDOM_PASSWORD_KEY } from '../lib/constants';
|
||||
import database from '../lib/database';
|
||||
import RocketChat from '../lib/rocketchat';
|
||||
import UserPreferences from '../lib/userPreferences';
|
||||
import UserPreferences from '../lib/methods/userPreferences';
|
||||
import { getUserSelector } from '../selectors/login';
|
||||
import { showErrorAlert } from '../utils/info';
|
||||
import I18n from '../i18n';
|
||||
|
|
|
@ -2,7 +2,7 @@ import { put, takeLatest } from 'redux-saga/effects';
|
|||
import RNBootSplash from 'react-native-bootsplash';
|
||||
|
||||
import { BIOMETRY_ENABLED_KEY } from '../constants/localAuthentication';
|
||||
import UserPreferences from '../lib/userPreferences';
|
||||
import UserPreferences from '../lib/methods/userPreferences';
|
||||
import { selectServerRequest } from '../actions/server';
|
||||
import { setAllPreferences } from '../actions/sortPreferences';
|
||||
import { APP } from '../actions/actionsTypes';
|
||||
|
|
|
@ -16,7 +16,7 @@ import { inviteLinksRequest } from '../actions/inviteLinks';
|
|||
import { showErrorAlert } from '../utils/info';
|
||||
import { localAuthenticate } from '../utils/localAuthentication';
|
||||
import { encryptionInit, encryptionStop } from '../actions/encryption';
|
||||
import UserPreferences from '../lib/userPreferences';
|
||||
import UserPreferences from '../lib/methods/userPreferences';
|
||||
import { inquiryRequest, inquiryReset } from '../ee/omnichannel/actions/inquiry';
|
||||
import { isOmnichannelStatusAvailable } from '../ee/omnichannel/lib';
|
||||
import { RootEnum } from '../definitions';
|
||||
|
|
|
@ -17,7 +17,7 @@ import log, { logServerVersion } from '../utils/log';
|
|||
import I18n from '../i18n';
|
||||
import { BASIC_AUTH_KEY, setBasicAuth } from '../utils/fetch';
|
||||
import { appStart } from '../actions/app';
|
||||
import UserPreferences from '../lib/userPreferences';
|
||||
import UserPreferences from '../lib/methods/userPreferences';
|
||||
import { encryptionStop } from '../actions/encryption';
|
||||
import SSLPinning from '../utils/sslPinning';
|
||||
import { inquiryReset } from '../ee/omnichannel/actions/inquiry';
|
||||
|
|
|
@ -6,7 +6,7 @@ import { createStackNavigator } from '@react-navigation/stack';
|
|||
import { Provider } from 'react-redux';
|
||||
|
||||
import { getTheme, initialTheme, newThemeState, subscribeTheme, unsubscribeTheme } from './utils/theme';
|
||||
import UserPreferences from './lib/userPreferences';
|
||||
import UserPreferences from './lib/methods/userPreferences';
|
||||
import Navigation from './lib/ShareNavigation';
|
||||
import store from './lib/createStore';
|
||||
import { initStore } from './lib/auxStore';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { compareServerVersion } from '../lib/utils';
|
||||
import { SubscriptionType } from '../definitions/ISubscription';
|
||||
import { IAvatar } from '../containers/Avatar/interfaces';
|
||||
import { compareServerVersion } from '../lib/methods/helpers/compareServerVersion';
|
||||
|
||||
const formatUrl = (url: string, size: number, query: string) => `${url}?format=png&size=${size}${query}`;
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import AsyncStorage from '@react-native-community/async-storage';
|
|||
import { sha256 } from 'js-sha256';
|
||||
import moment from 'moment';
|
||||
|
||||
import UserPreferences from '../lib/userPreferences';
|
||||
import UserPreferences from '../lib/methods/userPreferences';
|
||||
import { store } from '../lib/auxStore';
|
||||
import database from '../lib/database';
|
||||
import { getServerTimeSync } from '../lib/rocketchat/services/getServerTimeSync';
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Linking } from 'react-native';
|
|||
import * as WebBrowser from 'expo-web-browser';
|
||||
import parse from 'url-parse';
|
||||
|
||||
import UserPreferences from '../lib/userPreferences';
|
||||
import UserPreferences from '../lib/methods/userPreferences';
|
||||
import { themes } from '../constants/colors';
|
||||
|
||||
export const DEFAULT_BROWSER_KEY = 'DEFAULT_BROWSER_KEY';
|
||||
|
|
|
@ -2,7 +2,7 @@ import { Alert, NativeModules, Platform } from 'react-native';
|
|||
import DocumentPicker from 'react-native-document-picker';
|
||||
import * as FileSystem from 'expo-file-system';
|
||||
|
||||
import UserPreferences from '../lib/userPreferences';
|
||||
import UserPreferences from '../lib/methods/userPreferences';
|
||||
import I18n from '../i18n';
|
||||
import { extractHostname } from './server';
|
||||
import { ICertificate } from '../definitions';
|
||||
|
|
|
@ -5,11 +5,10 @@ import setRootViewColor from 'rn-root-view';
|
|||
import { IThemePreference, TThemeMode } from '../definitions/ITheme';
|
||||
import { themes } from '../constants/colors';
|
||||
import { isAndroid } from './deviceInfo';
|
||||
import UserPreferences from '../lib/userPreferences';
|
||||
import UserPreferences from '../lib/methods/userPreferences';
|
||||
import { THEME_PREFERENCES_KEY } from '../lib/constants';
|
||||
import { TSupportedThemes } from '../theme';
|
||||
|
||||
|
||||
let themeListener: { remove: () => void } | null;
|
||||
|
||||
export const initialTheme = (): IThemePreference => {
|
||||
|
|
|
@ -16,7 +16,6 @@ import I18n from '../i18n';
|
|||
import { withTheme } from '../theme';
|
||||
import { ImageViewer } from '../presentation/ImageViewer';
|
||||
import { themes } from '../constants/colors';
|
||||
import { formatAttachmentUrl } from '../lib/utils';
|
||||
import RCActivityIndicator from '../containers/ActivityIndicator';
|
||||
import * as HeaderButton from '../containers/HeaderButton';
|
||||
import { isAndroid } from '../utils/deviceInfo';
|
||||
|
@ -26,6 +25,7 @@ import { getHeaderHeight } from '../containers/Header';
|
|||
import StatusBar from '../containers/StatusBar';
|
||||
import { InsideStackParamList } from '../stacks/types';
|
||||
import { IAttachment } from '../definitions/IAttachment';
|
||||
import { formatAttachmentUrl } from '../lib/methods/helpers/formatAttachmentUrl';
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
container: {
|
||||
|
|
|
@ -10,7 +10,7 @@ import * as List from '../containers/List';
|
|||
import { DEFAULT_BROWSER_KEY } from '../utils/openLink';
|
||||
import { isIOS } from '../utils/deviceInfo';
|
||||
import SafeAreaView from '../containers/SafeAreaView';
|
||||
import UserPreferences from '../lib/userPreferences';
|
||||
import UserPreferences from '../lib/methods/userPreferences';
|
||||
import { events, logEvent } from '../utils/log';
|
||||
|
||||
type TValue = 'inApp' | 'systemDefault:' | 'googlechrome:' | 'firefox:' | 'brave:';
|
||||
|
|
|
@ -13,7 +13,7 @@ import { LISTENER } from '../containers/Toast';
|
|||
import { IApplicationState, IBaseScreen } from '../definitions';
|
||||
import I18n from '../i18n';
|
||||
import { E2E_RANDOM_PASSWORD_KEY } from '../lib/constants';
|
||||
import UserPreferences from '../lib/userPreferences';
|
||||
import UserPreferences from '../lib/methods/userPreferences';
|
||||
import { E2ESaveYourPasswordStackParamList } from '../stacks/types';
|
||||
import { withTheme } from '../theme';
|
||||
import EventEmitter from '../utils/events';
|
||||
|
|
|
@ -16,9 +16,9 @@ import { IApplicationState, IBaseScreen, ISearch, TSubscriptionModel } from '../
|
|||
import I18n from '../i18n';
|
||||
import database from '../lib/database';
|
||||
import { CustomIcon } from '../lib/Icons';
|
||||
import { compareServerVersion } from '../lib/methods/helpers/compareServerVersion';
|
||||
import Navigation from '../lib/Navigation';
|
||||
import RocketChat from '../lib/rocketchat';
|
||||
import { compareServerVersion } from '../lib/utils';
|
||||
import UserItem from '../presentation/UserItem';
|
||||
import { withTheme } from '../theme';
|
||||
import { goRoom } from '../utils/goRoom';
|
||||
|
|
|
@ -20,7 +20,7 @@ import I18n from '../../i18n';
|
|||
import database from '../../lib/database';
|
||||
import { sanitizeLikeString } from '../../lib/database/utils';
|
||||
import RocketChat from '../../lib/rocketchat';
|
||||
import UserPreferences from '../../lib/userPreferences';
|
||||
import UserPreferences from '../../lib/methods/userPreferences';
|
||||
import { OutsideParamList } from '../../stacks/types';
|
||||
import { withTheme } from '../../theme';
|
||||
import { isTablet } from '../../utils/deviceInfo';
|
||||
|
|
|
@ -24,7 +24,6 @@ import database from '../../lib/database';
|
|||
import { E2E_ROOM_TYPES } from '../../lib/constants';
|
||||
import protectedFunction from '../../lib/methods/helpers/protectedFunction';
|
||||
import RocketChat from '../../lib/rocketchat';
|
||||
import { compareServerVersion } from '../../lib/utils';
|
||||
import { getUserSelector } from '../../selectors/login';
|
||||
import { ChatsStackParamList } from '../../stacks/types';
|
||||
import { withTheme } from '../../theme';
|
||||
|
@ -34,6 +33,7 @@ import Touch from '../../utils/touch';
|
|||
import sharedStyles from '../Styles';
|
||||
import styles from './styles';
|
||||
import { ERoomType } from '../../definitions/ERoomType';
|
||||
import { compareServerVersion } from '../../lib/methods/helpers/compareServerVersion';
|
||||
|
||||
interface IRoomActionsViewProps extends IBaseScreen<ChatsStackParamList, 'RoomActionsView'> {
|
||||
userId: string;
|
||||
|
|
|
@ -22,7 +22,6 @@ import I18n from '../../i18n';
|
|||
import database from '../../lib/database';
|
||||
import { CustomIcon } from '../../lib/Icons';
|
||||
import RocketChat from '../../lib/rocketchat';
|
||||
import { compareServerVersion } from '../../lib/utils';
|
||||
import KeyboardView from '../../presentation/KeyboardView';
|
||||
import { TSupportedPermissions } from '../../reducers/permissions';
|
||||
import { ModalStackParamList } from '../../stacks/MasterDetailStack/types';
|
||||
|
@ -38,6 +37,7 @@ import { IAvatar } from '../../definitions/IProfileViewInterfaces';
|
|||
import sharedStyles from '../Styles';
|
||||
import styles from './styles';
|
||||
import SwitchContainer from './SwitchContainer';
|
||||
import { compareServerVersion } from '../../lib/methods/helpers/compareServerVersion';
|
||||
|
||||
interface IRoomInfoEditViewState {
|
||||
room: ISubscription;
|
||||
|
|
|
@ -10,8 +10,8 @@ import { themes } from '../../../constants/colors';
|
|||
import ActivityIndicator from '../../../containers/ActivityIndicator';
|
||||
import { TAnyMessageModel, TMessageModel, TThreadMessageModel, TThreadModel } from '../../../definitions';
|
||||
import database from '../../../lib/database';
|
||||
import { compareServerVersion } from '../../../lib/methods/helpers/compareServerVersion';
|
||||
import RocketChat from '../../../lib/rocketchat';
|
||||
import { compareServerVersion } from '../../../lib/utils';
|
||||
import debounce from '../../../utils/debounce';
|
||||
import { animateNextTransition } from '../../../utils/layoutAnimation';
|
||||
import log from '../../../utils/log';
|
||||
|
|
|
@ -23,7 +23,7 @@ import { showConfirmationAlert } from '../../utils/info';
|
|||
import log, { events, logEvent } from '../../utils/log';
|
||||
import { headerHeight } from '../../containers/Header';
|
||||
import { goRoom } from '../../utils/goRoom';
|
||||
import UserPreferences from '../../lib/userPreferences';
|
||||
import UserPreferences from '../../lib/methods/userPreferences';
|
||||
import { IApplicationState, IBaseScreen, RootEnum, TServerModel } from '../../definitions';
|
||||
import styles from './styles';
|
||||
import { ChatsStackParamList } from '../../stacks/types';
|
||||
|
|
|
@ -15,7 +15,7 @@ import { BIOMETRY_ENABLED_KEY, DEFAULT_AUTO_LOCK } from '../constants/localAuthe
|
|||
import SafeAreaView from '../containers/SafeAreaView';
|
||||
import { events, logEvent } from '../utils/log';
|
||||
import { TServerModel } from '../definitions/IServer';
|
||||
import userPreferences from '../lib/userPreferences';
|
||||
import userPreferences from '../lib/methods/userPreferences';
|
||||
|
||||
const DEFAULT_BIOMETRY = false;
|
||||
|
||||
|
|
|
@ -29,10 +29,10 @@ import { sanitizeLikeString } from '../../lib/database/utils';
|
|||
import getThreadName from '../../lib/methods/getThreadName';
|
||||
import getRoomInfo, { IRoomInfoResult } from '../../lib/methods/getRoomInfo';
|
||||
import { isIOS } from '../../utils/deviceInfo';
|
||||
import { compareServerVersion } from '../../lib/utils';
|
||||
import styles from './styles';
|
||||
import { InsideStackParamList, ChatsStackParamList } from '../../stacks/types';
|
||||
import { IEmoji } from '../../definitions/IEmoji';
|
||||
import { compareServerVersion } from '../../lib/methods/helpers/compareServerVersion';
|
||||
|
||||
const QUERY_SIZE = 50;
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import StatusBar from '../containers/StatusBar';
|
|||
import * as List from '../containers/List';
|
||||
import { supportSystemTheme } from '../utils/deviceInfo';
|
||||
import SafeAreaView from '../containers/SafeAreaView';
|
||||
import UserPreferences from '../lib/userPreferences';
|
||||
import UserPreferences from '../lib/methods/userPreferences';
|
||||
import { events, logEvent } from '../utils/log';
|
||||
import { IThemePreference, TThemeMode, TDarkLevel } from '../definitions/ITheme';
|
||||
import { THEME_PREFERENCES_KEY } from '../lib/constants';
|
||||
|
|
Loading…
Reference in New Issue