forked from Ivasoft/mattermost-mobile
Upgrade deps (#5850)
This commit is contained in:
@@ -96,7 +96,7 @@ export const fetchMyChannelsForTeam = async (serverUrl: string, teamId: string,
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
let [channels, memberships] = await Promise.all<Channel[], ChannelMembership[]>([
|
let [channels, memberships]: [Channel[], ChannelMembership[]] = await Promise.all([
|
||||||
client.getMyChannels(teamId, includeDeleted, since),
|
client.getMyChannels(teamId, includeDeleted, since),
|
||||||
client.getMyChannelMembers(teamId),
|
client.getMyChannelMembers(teamId),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export const fetchGroupsForTeam = async (serverUrl: string, teamId: string) => {
|
|||||||
const groupsTeams: GroupTeamRelation[] = [];
|
const groupsTeams: GroupTeamRelation[] = [];
|
||||||
const groupMemberships: GroupMembership[] = [];
|
const groupMemberships: GroupMembership[] = [];
|
||||||
if (team.isGroupConstrained) {
|
if (team.isGroupConstrained) {
|
||||||
const [groupsAssociatedToChannelsInTeam, groupsAssociatedToTeam] = await Promise.all<{groups: Record<string, Group[]>}, {groups: Group[]; total_group_count: number}>([
|
const [groupsAssociatedToChannelsInTeam, groupsAssociatedToTeam]: [{groups: Record<string, Group[]>}, {groups: Group[]; total_group_count: number}] = await Promise.all([
|
||||||
client.getAllGroupsAssociatedToChannelsInTeam(teamId, true),
|
client.getAllGroupsAssociatedToChannelsInTeam(teamId, true),
|
||||||
client.getAllGroupsAssociatedToTeam(teamId, true),
|
client.getAllGroupsAssociatedToTeam(teamId, true),
|
||||||
]);
|
]);
|
||||||
@@ -60,7 +60,7 @@ export const fetchGroupsForTeam = async (serverUrl: string, teamId: string) => {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const since = await queryWebSocketLastDisconnected(database);
|
const since = await queryWebSocketLastDisconnected(database);
|
||||||
const [groupsAssociatedToChannelsInTeam, allGroups] = await Promise.all<{groups: Record<string, Group[]>}, Group[]>([
|
const [groupsAssociatedToChannelsInTeam, allGroups]: [{groups: Record<string, Group[]>}, Group[]] = await Promise.all([
|
||||||
client.getAllGroupsAssociatedToChannelsInTeam(teamId, true),
|
client.getAllGroupsAssociatedToChannelsInTeam(teamId, true),
|
||||||
client.getGroups(true, 0, 0, since),
|
client.getGroups(true, 0, 0, since),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export const fetchConfigAndLicense = async (serverUrl: string, fetchOnly = false
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const [config, license] = await Promise.all<ClientConfig, ClientLicense>([
|
const [config, license]: [ClientConfig, ClientLicense] = await Promise.all([
|
||||||
client.getClientConfigOld(),
|
client.getClientConfigOld(),
|
||||||
client.getClientLicenseOld(),
|
client.getClientLicenseOld(),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ export const fetchMyTeams = async (serverUrl: string, fetchOnly = false): Promis
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const [teams, memberships] = await Promise.all<Team[], TeamMembership[]>([
|
const [teams, memberships]: [Team[], TeamMembership[]] = await Promise.all([
|
||||||
client.getMyTeams(),
|
client.getMyTeams(),
|
||||||
client.getMyTeamMembers(),
|
client.getMyTeamMembers(),
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const ClientApps = (superclass: any) => class extends superclass {
|
|||||||
`${this.getAppsProxyRoute()}/api/v1/call`,
|
`${this.getAppsProxyRoute()}/api/v1/call`,
|
||||||
{method: 'post', body: callCopy},
|
{method: 'post', body: callCopy},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
getAppsBindings = async (userID: string, channelID: string, teamID: string) => {
|
getAppsBindings = async (userID: string, channelID: string, teamID: string) => {
|
||||||
const params = {
|
const params = {
|
||||||
@@ -37,7 +37,7 @@ const ClientApps = (superclass: any) => class extends superclass {
|
|||||||
`${this.getAppsProxyRoute()}/api/v1/bindings${buildQueryString(params)}`,
|
`${this.getAppsProxyRoute()}/api/v1/bindings${buildQueryString(params)}`,
|
||||||
{method: 'get'},
|
{method: 'get'},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ClientApps;
|
export default ClientApps;
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export default class ClientBase {
|
|||||||
|
|
||||||
getWebSocketUrl = () => {
|
getWebSocketUrl = () => {
|
||||||
return `${this.urlVersion}/websocket`;
|
return `${this.urlVersion}/websocket`;
|
||||||
}
|
};
|
||||||
|
|
||||||
setAcceptLanguage(locale: string) {
|
setAcceptLanguage(locale: string) {
|
||||||
this.requestHeaders[ClientConstants.HEADER_ACCEPT_LANGUAGE] = locale;
|
this.requestHeaders[ClientConstants.HEADER_ACCEPT_LANGUAGE] = locale;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ const ClientFiles = (superclass: any) => class extends superclass {
|
|||||||
`${this.getFileRoute(fileId)}/link`,
|
`${this.getFileRoute(fileId)}/link`,
|
||||||
{method: 'get'},
|
{method: 'get'},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ClientFiles;
|
export default ClientFiles;
|
||||||
|
|||||||
@@ -26,7 +26,8 @@ const ClientGroups = (superclass: any) => class extends superclass {
|
|||||||
`${this.getUsersRoute()}/${userID}/groups`,
|
`${this.getUsersRoute()}/${userID}/groups`,
|
||||||
{method: 'get'},
|
{method: 'get'},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
getAllGroupsAssociatedToTeam = async (teamID: string, filterAllowReference = false) => {
|
getAllGroupsAssociatedToTeam = async (teamID: string, filterAllowReference = false) => {
|
||||||
return this.doFetch(
|
return this.doFetch(
|
||||||
`${this.urlVersion}/teams/${teamID}/groups${buildQueryString({paginate: false, filter_allow_reference: filterAllowReference})}`,
|
`${this.urlVersion}/teams/${teamID}/groups${buildQueryString({paginate: false, filter_allow_reference: filterAllowReference})}`,
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ const ClientPosts = (superclass: any) => class extends superclass {
|
|||||||
`${this.getUserRoute(userId)}/posts/${postId}/set_unread`,
|
`${this.getUserRoute(userId)}/posts/${postId}/set_unread`,
|
||||||
{method: 'post'},
|
{method: 'post'},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
pinPost = async (postId: string) => {
|
pinPost = async (postId: string) => {
|
||||||
this.analytics.trackAPI('api_posts_pin');
|
this.analytics.trackAPI('api_posts_pin');
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ const ClientTos = (superclass: any) => class extends superclass {
|
|||||||
`${this.getUserRoute('me')}/terms_of_service`,
|
`${this.getUserRoute('me')}/terms_of_service`,
|
||||||
{method: 'post', body: {termsOfServiceId, accepted}},
|
{method: 'post', body: {termsOfServiceId, accepted}},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
getTermsOfService = async () => {
|
getTermsOfService = async () => {
|
||||||
return this.doFetch(
|
return this.doFetch(
|
||||||
`${this.urlVersion}/terms_of_service`,
|
`${this.urlVersion}/terms_of_service`,
|
||||||
{method: 'get'},
|
{method: 'get'},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export default ClientTos;
|
export default ClientTos;
|
||||||
|
|||||||
@@ -64,14 +64,14 @@ const ClientUsers = (superclass: any) => class extends superclass {
|
|||||||
`${this.getUsersRoute()}${buildQueryString(queryParams)}`,
|
`${this.getUsersRoute()}${buildQueryString(queryParams)}`,
|
||||||
{method: 'post', body: user},
|
{method: 'post', body: user},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
patchMe = async (userPatch: Partial<UserProfile>) => {
|
patchMe = async (userPatch: Partial<UserProfile>) => {
|
||||||
return this.doFetch(
|
return this.doFetch(
|
||||||
`${this.getUserRoute('me')}/patch`,
|
`${this.getUserRoute('me')}/patch`,
|
||||||
{method: 'put', body: userPatch},
|
{method: 'put', body: userPatch},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
patchUser = async (userPatch: Partial<UserProfile> & {id: string}) => {
|
patchUser = async (userPatch: Partial<UserProfile> & {id: string}) => {
|
||||||
this.analytics.trackAPI('api_users_patch');
|
this.analytics.trackAPI('api_users_patch');
|
||||||
@@ -80,7 +80,7 @@ const ClientUsers = (superclass: any) => class extends superclass {
|
|||||||
`${this.getUserRoute(userPatch.id)}/patch`,
|
`${this.getUserRoute(userPatch.id)}/patch`,
|
||||||
{method: 'put', body: userPatch},
|
{method: 'put', body: userPatch},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
updateUser = async (user: UserProfile) => {
|
updateUser = async (user: UserProfile) => {
|
||||||
this.analytics.trackAPI('api_users_update');
|
this.analytics.trackAPI('api_users_update');
|
||||||
@@ -89,7 +89,7 @@ const ClientUsers = (superclass: any) => class extends superclass {
|
|||||||
`${this.getUserRoute(user.id)}`,
|
`${this.getUserRoute(user.id)}`,
|
||||||
{method: 'put', body: user},
|
{method: 'put', body: user},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
demoteUserToGuest = async (userId: string) => {
|
demoteUserToGuest = async (userId: string) => {
|
||||||
this.analytics.trackAPI('api_users_demote_user_to_guest');
|
this.analytics.trackAPI('api_users_demote_user_to_guest');
|
||||||
@@ -98,7 +98,7 @@ const ClientUsers = (superclass: any) => class extends superclass {
|
|||||||
`${this.getUserRoute(userId)}/demote`,
|
`${this.getUserRoute(userId)}/demote`,
|
||||||
{method: 'post'},
|
{method: 'post'},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
getKnownUsers = async () => {
|
getKnownUsers = async () => {
|
||||||
this.analytics.trackAPI('api_get_known_users');
|
this.analytics.trackAPI('api_get_known_users');
|
||||||
@@ -107,7 +107,7 @@ const ClientUsers = (superclass: any) => class extends superclass {
|
|||||||
`${this.getUsersRoute()}/known`,
|
`${this.getUsersRoute()}/known`,
|
||||||
{method: 'get'},
|
{method: 'get'},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
sendPasswordResetEmail = async (email: string) => {
|
sendPasswordResetEmail = async (email: string) => {
|
||||||
this.analytics.trackAPI('api_users_send_password_reset');
|
this.analytics.trackAPI('api_users_send_password_reset');
|
||||||
@@ -116,7 +116,7 @@ const ClientUsers = (superclass: any) => class extends superclass {
|
|||||||
`${this.getUsersRoute()}/password/reset/send`,
|
`${this.getUsersRoute()}/password/reset/send`,
|
||||||
{method: 'post', body: {email}},
|
{method: 'post', body: {email}},
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
setDefaultProfileImage = async (userId: string) => {
|
setDefaultProfileImage = async (userId: string) => {
|
||||||
this.analytics.trackAPI('api_users_set_default_profile_picture');
|
this.analytics.trackAPI('api_users_set_default_profile_picture');
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import Database from '@nozbe/watermelondb/Database';
|
import Database from '@nozbe/watermelondb/Database';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
|||||||
@@ -268,5 +268,7 @@ const FloatingTextInput = forwardRef<FloatingTextInputRef, FloatingTextInputProp
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
FloatingTextInput.displayName = 'FloatingTextInput';
|
||||||
|
|
||||||
export default FloatingTextInput;
|
export default FloatingTextInput;
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ class MarkdownTable extends PureComponent<MarkdownTableProps, MarkdownTableState
|
|||||||
setMaxPreviewColumns = ({window}: {window: ScaledSize}) => {
|
setMaxPreviewColumns = ({window}: {window: ScaledSize}) => {
|
||||||
const maxPreviewColumns = Math.floor(window.width / CELL_MIN_WIDTH);
|
const maxPreviewColumns = Math.floor(window.width / CELL_MIN_WIDTH);
|
||||||
this.setState({maxPreviewColumns});
|
this.setState({maxPreviewColumns});
|
||||||
}
|
};
|
||||||
|
|
||||||
getTableWidth = (isFullView = false) => {
|
getTableWidth = (isFullView = false) => {
|
||||||
const maxPreviewColumns = this.state.maxPreviewColumns || MAX_PREVIEW_COLUMNS;
|
const maxPreviewColumns = this.state.maxPreviewColumns || MAX_PREVIEW_COLUMNS;
|
||||||
@@ -99,7 +99,7 @@ class MarkdownTable extends PureComponent<MarkdownTableProps, MarkdownTableState
|
|||||||
|
|
||||||
renderPreviewRows = (isFullView = false) => {
|
renderPreviewRows = (isFullView = false) => {
|
||||||
return this.renderRows(isFullView, true);
|
return this.renderRows(isFullView, true);
|
||||||
}
|
};
|
||||||
|
|
||||||
shouldRenderAsFlex = (isFullView = false) => {
|
shouldRenderAsFlex = (isFullView = false) => {
|
||||||
const {numColumns} = this.props;
|
const {numColumns} = this.props;
|
||||||
@@ -125,7 +125,7 @@ class MarkdownTable extends PureComponent<MarkdownTableProps, MarkdownTableState
|
|||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
};
|
||||||
|
|
||||||
getTableStyle = (isFullView: boolean) => {
|
getTableStyle = (isFullView: boolean) => {
|
||||||
const {theme} = this.props;
|
const {theme} = this.props;
|
||||||
@@ -140,7 +140,7 @@ class MarkdownTable extends PureComponent<MarkdownTableProps, MarkdownTableState
|
|||||||
|
|
||||||
tableStyle.push({width: this.getTableWidth(isFullView)});
|
tableStyle.push({width: this.getTableWidth(isFullView)});
|
||||||
return tableStyle;
|
return tableStyle;
|
||||||
}
|
};
|
||||||
|
|
||||||
renderRows = (isFullView = false, isPreview = false) => {
|
renderRows = (isFullView = false, isPreview = false) => {
|
||||||
const tableStyle = this.getTableStyle(isFullView);
|
const tableStyle = this.getTableStyle(isFullView);
|
||||||
@@ -186,7 +186,7 @@ class MarkdownTable extends PureComponent<MarkdownTableProps, MarkdownTableState
|
|||||||
{rows}
|
{rows}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {containerWidth, contentHeight} = this.state;
|
const {containerWidth, contentHeight} = this.state;
|
||||||
|
|||||||
@@ -200,4 +200,6 @@ const DocumentFile = forwardRef<DocumentFileRef, DocumentFileProps>(({background
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
DocumentFile.displayName = 'DocumentFile';
|
||||||
|
|
||||||
export default DocumentFile;
|
export default DocumentFile;
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
|
/* eslint-disable react/prop-types */
|
||||||
|
// We disable the prop types check here as forwardRef & typescript has a bug
|
||||||
|
|
||||||
import React, {forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState} from 'react';
|
import React, {forwardRef, useCallback, useImperativeHandle, useMemo, useRef, useState} from 'react';
|
||||||
import {useIntl} from 'react-intl';
|
import {useIntl} from 'react-intl';
|
||||||
import {ActivityIndicatorProps, Platform, StyleProp, TextInput, TextInputProps, TextStyle, TouchableOpacityProps, ViewStyle} from 'react-native';
|
import {ActivityIndicatorProps, Platform, StyleProp, TextInput, TextInputProps, TextStyle, TouchableOpacityProps, ViewStyle} from 'react-native';
|
||||||
|
|||||||
@@ -175,7 +175,7 @@ class DatabaseManager {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
public updateServerDisplayName = async (serverUrl: string, displayName: string) => {
|
public updateServerDisplayName = async (serverUrl: string, displayName: string) => {
|
||||||
const appDatabase = this.appDatabase?.database;
|
const appDatabase = this.appDatabase?.database;
|
||||||
@@ -187,7 +187,7 @@ class DatabaseManager {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
private isServerPresent = async (serverUrl: string): Promise<boolean> => {
|
private isServerPresent = async (serverUrl: string): Promise<boolean> => {
|
||||||
if (this.appDatabase?.database) {
|
if (this.appDatabase?.database) {
|
||||||
@@ -196,7 +196,7 @@ class DatabaseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
};
|
||||||
|
|
||||||
public getActiveServerUrl = async (): Promise<string|null|undefined> => {
|
public getActiveServerUrl = async (): Promise<string|null|undefined> => {
|
||||||
const database = this.appDatabase?.database;
|
const database = this.appDatabase?.database;
|
||||||
@@ -206,7 +206,7 @@ class DatabaseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
};
|
||||||
|
|
||||||
public getServerUrlFromIdentifier = async (identifier: string): Promise<string|undefined> => {
|
public getServerUrlFromIdentifier = async (identifier: string): Promise<string|undefined> => {
|
||||||
const database = this.appDatabase?.database;
|
const database = this.appDatabase?.database;
|
||||||
@@ -216,7 +216,7 @@ class DatabaseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
};
|
||||||
|
|
||||||
public getActiveServerDatabase = async (): Promise<Database|undefined> => {
|
public getActiveServerDatabase = async (): Promise<Database|undefined> => {
|
||||||
const database = this.appDatabase?.database;
|
const database = this.appDatabase?.database;
|
||||||
@@ -228,7 +228,7 @@ class DatabaseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
};
|
||||||
|
|
||||||
public setActiveServerDatabase = async (serverUrl: string): Promise<void> => {
|
public setActiveServerDatabase = async (serverUrl: string): Promise<void> => {
|
||||||
if (this.appDatabase?.database) {
|
if (this.appDatabase?.database) {
|
||||||
@@ -260,7 +260,7 @@ class DatabaseManager {
|
|||||||
this.deleteServerDatabaseFiles(serverUrl);
|
this.deleteServerDatabaseFiles(serverUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
public destroyServerDatabase = async (serverUrl: string): Promise<void> => {
|
public destroyServerDatabase = async (serverUrl: string): Promise<void> => {
|
||||||
if (this.appDatabase?.database) {
|
if (this.appDatabase?.database) {
|
||||||
@@ -275,7 +275,7 @@ class DatabaseManager {
|
|||||||
this.deleteServerDatabaseFiles(serverUrl);
|
this.deleteServerDatabaseFiles(serverUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
private deleteServerDatabaseFiles = async (serverUrl: string): Promise<void> => {
|
private deleteServerDatabaseFiles = async (serverUrl: string): Promise<void> => {
|
||||||
const databaseName = hashCode(serverUrl);
|
const databaseName = hashCode(serverUrl);
|
||||||
@@ -293,7 +293,7 @@ class DatabaseManager {
|
|||||||
|
|
||||||
await FileSystem.deleteAsync(databaseFile);
|
await FileSystem.deleteAsync(databaseFile);
|
||||||
await FileSystem.deleteAsync(databaseJournal);
|
await FileSystem.deleteAsync(databaseJournal);
|
||||||
}
|
};
|
||||||
|
|
||||||
factoryReset = async (shouldRemoveDirectory: boolean): Promise<boolean> => {
|
factoryReset = async (shouldRemoveDirectory: boolean): Promise<boolean> => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ class DatabaseManager {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
public updateServerDisplayName = async (serverUrl: string, displayName: string) => {
|
public updateServerDisplayName = async (serverUrl: string, displayName: string) => {
|
||||||
const appDatabase = this.appDatabase?.database;
|
const appDatabase = this.appDatabase?.database;
|
||||||
@@ -232,7 +232,7 @@ class DatabaseManager {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* isServerPresent : Confirms if the current serverUrl does not already exist in the database
|
* isServerPresent : Confirms if the current serverUrl does not already exist in the database
|
||||||
@@ -246,7 +246,7 @@ class DatabaseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getActiveServerUrl: Get the record for active server database.
|
* getActiveServerUrl: Get the record for active server database.
|
||||||
@@ -260,7 +260,7 @@ class DatabaseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
};
|
||||||
|
|
||||||
public getServerUrlFromIdentifier = async (identifier: string): Promise<string|undefined> => {
|
public getServerUrlFromIdentifier = async (identifier: string): Promise<string|undefined> => {
|
||||||
const database = this.appDatabase?.database;
|
const database = this.appDatabase?.database;
|
||||||
@@ -270,7 +270,7 @@ class DatabaseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* getActiveServerDatabase: Get the record for active server database.
|
* getActiveServerDatabase: Get the record for active server database.
|
||||||
@@ -286,7 +286,7 @@ class DatabaseManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* setActiveServerDatabase: Set the new active server database.
|
* setActiveServerDatabase: Set the new active server database.
|
||||||
@@ -330,7 +330,7 @@ class DatabaseManager {
|
|||||||
this.deleteServerDatabaseFiles(serverUrl);
|
this.deleteServerDatabaseFiles(serverUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* destroyServerDatabase: Removes the *.db file from the App-Group directory for iOS or the files directory on Android.
|
* destroyServerDatabase: Removes the *.db file from the App-Group directory for iOS or the files directory on Android.
|
||||||
@@ -351,7 +351,7 @@ class DatabaseManager {
|
|||||||
this.deleteServerDatabaseFiles(serverUrl);
|
this.deleteServerDatabaseFiles(serverUrl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* deleteServerDatabaseFiles: Removes the *.db file from the App-Group directory for iOS or the files directory on Android.
|
* deleteServerDatabaseFiles: Removes the *.db file from the App-Group directory for iOS or the files directory on Android.
|
||||||
@@ -376,7 +376,7 @@ class DatabaseManager {
|
|||||||
FileSystem.deleteAsync(databaseFile);
|
FileSystem.deleteAsync(databaseFile);
|
||||||
FileSystem.deleteAsync(databaseShm);
|
FileSystem.deleteAsync(databaseShm);
|
||||||
FileSystem.deleteAsync(databaseWal);
|
FileSystem.deleteAsync(databaseWal);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* factoryReset: Removes the databases directory and all its contents on the respective platform
|
* factoryReset: Removes the databases directory and all its contents on the respective platform
|
||||||
|
|||||||
@@ -140,5 +140,5 @@ export default class UserModel extends Model {
|
|||||||
this.prepareUpdate((u) => {
|
this.prepareUpdate((u) => {
|
||||||
u.status = status;
|
u.status = status;
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export default class AppDataOperator extends BaseDataOperator {
|
|||||||
createOrUpdateRawValues: getUniqueRawsBy({raws: info, key: 'version_number'}),
|
createOrUpdateRawValues: getUniqueRawsBy({raws: info, key: 'version_number'}),
|
||||||
tableName: INFO,
|
tableName: INFO,
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
handleGlobal = async ({global, prepareRecordsOnly = true}: HandleGlobalArgs) => {
|
handleGlobal = async ({global, prepareRecordsOnly = true}: HandleGlobalArgs) => {
|
||||||
if (!global.length) {
|
if (!global.length) {
|
||||||
@@ -45,5 +45,5 @@ export default class AppDataOperator extends BaseDataOperator {
|
|||||||
createOrUpdateRawValues: getUniqueRawsBy({raws: global, key: 'id'}),
|
createOrUpdateRawValues: getUniqueRawsBy({raws: global, key: 'id'}),
|
||||||
tableName: GLOBAL,
|
tableName: GLOBAL,
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export default class ServerDataOperatorBase extends BaseDataOperator {
|
|||||||
createOrUpdateRawValues: getUniqueRawsBy({raws: roles, key: 'id'}),
|
createOrUpdateRawValues: getUniqueRawsBy({raws: roles, key: 'id'}),
|
||||||
tableName: ROLE,
|
tableName: ROLE,
|
||||||
}) as Promise<RoleModel[]>;
|
}) as Promise<RoleModel[]>;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleCustomEmojis = ({emojis, prepareRecordsOnly = true}: HandleCustomEmojiArgs) => {
|
handleCustomEmojis = ({emojis, prepareRecordsOnly = true}: HandleCustomEmojiArgs) => {
|
||||||
if (!emojis.length) {
|
if (!emojis.length) {
|
||||||
@@ -60,7 +60,7 @@ export default class ServerDataOperatorBase extends BaseDataOperator {
|
|||||||
createOrUpdateRawValues: getUniqueRawsBy({raws: emojis, key: 'name'}),
|
createOrUpdateRawValues: getUniqueRawsBy({raws: emojis, key: 'name'}),
|
||||||
tableName: CUSTOM_EMOJI,
|
tableName: CUSTOM_EMOJI,
|
||||||
}) as Promise<CustomEmojiModel[]>;
|
}) as Promise<CustomEmojiModel[]>;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleSystem = ({systems, prepareRecordsOnly = true}: HandleSystemArgs) => {
|
handleSystem = ({systems, prepareRecordsOnly = true}: HandleSystemArgs) => {
|
||||||
if (!systems.length) {
|
if (!systems.length) {
|
||||||
@@ -77,7 +77,7 @@ export default class ServerDataOperatorBase extends BaseDataOperator {
|
|||||||
createOrUpdateRawValues: getUniqueRawsBy({raws: systems, key: 'id'}),
|
createOrUpdateRawValues: getUniqueRawsBy({raws: systems, key: 'id'}),
|
||||||
tableName: SYSTEM,
|
tableName: SYSTEM,
|
||||||
}) as Promise<SystemModel[]>;
|
}) as Promise<SystemModel[]>;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleTermOfService = ({termOfService, prepareRecordsOnly = true}: HandleTOSArgs) => {
|
handleTermOfService = ({termOfService, prepareRecordsOnly = true}: HandleTOSArgs) => {
|
||||||
if (!termOfService.length) {
|
if (!termOfService.length) {
|
||||||
@@ -94,29 +94,29 @@ export default class ServerDataOperatorBase extends BaseDataOperator {
|
|||||||
createOrUpdateRawValues: getUniqueRawsBy({raws: termOfService, key: 'id'}),
|
createOrUpdateRawValues: getUniqueRawsBy({raws: termOfService, key: 'id'}),
|
||||||
tableName: TERMS_OF_SERVICE,
|
tableName: TERMS_OF_SERVICE,
|
||||||
}) as Promise<TermsOfServiceModel[]>;
|
}) as Promise<TermsOfServiceModel[]>;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* execute: Handles the Create/Update operations on an table.
|
* execute: Handles the Create/Update operations on an table.
|
||||||
* @param {OperationArgs} execute
|
* @param {OperationArgs} execute
|
||||||
* @param {string} execute.tableName
|
* @param {string} execute.tableName
|
||||||
* @param {RecordValue[]} execute.createRaws
|
* @param {RecordValue[]} execute.createRaws
|
||||||
* @param {RecordValue[]} execute.updateRaws
|
* @param {RecordValue[]} execute.updateRaws
|
||||||
* @param {(TransformerArgs) => Promise<Model>} execute.recordOperator
|
* @param {(TransformerArgs) => Promise<Model>} execute.recordOperator
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
execute = async ({createRaws, transformer, tableName, updateRaws}: OperationArgs): Promise<Model[]> => {
|
execute = async ({createRaws, transformer, tableName, updateRaws}: OperationArgs): Promise<Model[]> => {
|
||||||
const models = await this.prepareRecords({
|
const models = await this.prepareRecords({
|
||||||
tableName,
|
tableName,
|
||||||
createRaws,
|
createRaws,
|
||||||
updateRaws,
|
updateRaws,
|
||||||
transformer,
|
transformer,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (models?.length > 0) {
|
if (models?.length > 0) {
|
||||||
await this.batchRecords(models);
|
await this.batchRecords(models);
|
||||||
}
|
}
|
||||||
|
|
||||||
return models;
|
return models;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ const PostHandler = (superclass: any) => class extends superclass {
|
|||||||
if (batch.length) {
|
if (batch.length) {
|
||||||
await this.batchRecords(batch);
|
await this.batchRecords(batch);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* handleFiles: Handler responsible for the Create/Update operations occurring on the File table from the 'Server' schema
|
* handleFiles: Handler responsible for the Create/Update operations occurring on the File table from the 'Server' schema
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ const PostsInChannelHandler = (superclass: any) => class extends superclass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleReceivedPostsInChannel = async (posts: Post[], prepareRecordsOnly = false): Promise<PostsInChannelModel[]> => {
|
handleReceivedPostsInChannel = async (posts: Post[], prepareRecordsOnly = false): Promise<PostsInChannelModel[]> => {
|
||||||
if (!posts.length) {
|
if (!posts.length) {
|
||||||
@@ -168,11 +168,11 @@ const PostsInChannelHandler = (superclass: any) => class extends superclass {
|
|||||||
|
|
||||||
handleReceivedPostsInChannelBefore = async (posts: Post[], prepareRecordsOnly = false): Promise<PostsInChannelModel[]> => {
|
handleReceivedPostsInChannelBefore = async (posts: Post[], prepareRecordsOnly = false): Promise<PostsInChannelModel[]> => {
|
||||||
throw new Error(`handleReceivedPostsInChannelBefore Not implemented yet. posts count${posts.length} prepareRecordsOnly=${prepareRecordsOnly}`);
|
throw new Error(`handleReceivedPostsInChannelBefore Not implemented yet. posts count${posts.length} prepareRecordsOnly=${prepareRecordsOnly}`);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleReceivedPostsInChannelAfter = async (posts: Post[], prepareRecordsOnly = false): Promise<PostsInChannelModel[]> => {
|
handleReceivedPostsInChannelAfter = async (posts: Post[], prepareRecordsOnly = false): Promise<PostsInChannelModel[]> => {
|
||||||
throw new Error(`handleReceivedPostsInChannelAfter Not implemented yet. posts count${posts.length} prepareRecordsOnly=${prepareRecordsOnly}`);
|
throw new Error(`handleReceivedPostsInChannelAfter Not implemented yet. posts count${posts.length} prepareRecordsOnly=${prepareRecordsOnly}`);
|
||||||
}
|
};
|
||||||
|
|
||||||
handleReceivedPostForChannel = async (posts: Post[], prepareRecordsOnly = false): Promise<PostsInChannelModel[]> => {
|
handleReceivedPostForChannel = async (posts: Post[], prepareRecordsOnly = false): Promise<PostsInChannelModel[]> => {
|
||||||
if (!posts.length) {
|
if (!posts.length) {
|
||||||
@@ -221,7 +221,7 @@ const PostsInChannelHandler = (superclass: any) => class extends superclass {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return targetChunk;
|
return targetChunk;
|
||||||
}
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export default PostsInChannelHandler;
|
export default PostsInChannelHandler;
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ class GlobalEventHandler {
|
|||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Nothing to clear
|
// Nothing to clear
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
clearCookiesForServer = async (serverUrl: string) => {
|
clearCookiesForServer = async (serverUrl: string) => {
|
||||||
this.clearCookies(serverUrl, false);
|
this.clearCookies(serverUrl, false);
|
||||||
@@ -149,7 +149,7 @@ class GlobalEventHandler {
|
|||||||
} else {
|
} else {
|
||||||
resetMomentLocale();
|
resetMomentLocale();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
serverUpgradeNeeded = async (serverUrl: string) => {
|
serverUpgradeNeeded = async (serverUrl: string) => {
|
||||||
const credentials = await getServerCredentials(serverUrl);
|
const credentials = await getServerCredentials(serverUrl);
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class ManagedApp {
|
|||||||
Emm.setAppGroupId(appGroupIdentifier);
|
Emm.setAppGroupId(appGroupIdentifier);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
processConfig = async (config?: ManagedConfig) => {
|
processConfig = async (config?: ManagedConfig) => {
|
||||||
// If the managed configuration changed while authentication was
|
// If the managed configuration changed while authentication was
|
||||||
|
|||||||
@@ -58,12 +58,12 @@ class NetworkManager {
|
|||||||
console.log('NetworkManager init error', error); //eslint-disable-line no-console
|
console.log('NetworkManager init error', error); //eslint-disable-line no-console
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
public invalidateClient = (serverUrl: string) => {
|
public invalidateClient = (serverUrl: string) => {
|
||||||
this.clients[serverUrl]?.invalidate();
|
this.clients[serverUrl]?.invalidate();
|
||||||
delete this.clients[serverUrl];
|
delete this.clients[serverUrl];
|
||||||
}
|
};
|
||||||
|
|
||||||
public getClient = (serverUrl: string) => {
|
public getClient = (serverUrl: string) => {
|
||||||
const client = this.clients[serverUrl];
|
const client = this.clients[serverUrl];
|
||||||
@@ -72,7 +72,7 @@ class NetworkManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return client;
|
return client;
|
||||||
}
|
};
|
||||||
|
|
||||||
public createClient = async (serverUrl: string, bearerToken?: string) => {
|
public createClient = async (serverUrl: string, bearerToken?: string) => {
|
||||||
const config = await this.buildConfig();
|
const config = await this.buildConfig();
|
||||||
@@ -81,7 +81,7 @@ class NetworkManager {
|
|||||||
this.clients[serverUrl] = new Client(client, serverUrl, bearerToken, csrfToken);
|
this.clients[serverUrl] = new Client(client, serverUrl, bearerToken, csrfToken);
|
||||||
|
|
||||||
return this.clients[serverUrl];
|
return this.clients[serverUrl];
|
||||||
}
|
};
|
||||||
|
|
||||||
private buildConfig = async () => {
|
private buildConfig = async () => {
|
||||||
const userAgent = await DeviceInfo.getUserAgent();
|
const userAgent = await DeviceInfo.getUserAgent();
|
||||||
@@ -107,7 +107,7 @@ class NetworkManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
}
|
};
|
||||||
|
|
||||||
private clientErrorEventHandler: APIClientErrorEventHandler = (event: APIClientErrorEvent) => {
|
private clientErrorEventHandler: APIClientErrorEventHandler = (event: APIClientErrorEvent) => {
|
||||||
if (CLIENT_CERTIFICATE_IMPORT_ERROR_CODES.includes(event.errorCode)) {
|
if (CLIENT_CERTIFICATE_IMPORT_ERROR_CODES.includes(event.errorCode)) {
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ class PushNotifications {
|
|||||||
Notifications.ios.setBadgeCount(badgeCount);
|
Notifications.ios.setBadgeCount(badgeCount);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
createReplyCategory = () => {
|
createReplyCategory = () => {
|
||||||
const replyTitle = getLocalizedMessage(DEFAULT_LOCALE, t('mobile.push_notification_reply.title'));
|
const replyTitle = getLocalizedMessage(DEFAULT_LOCALE, t('mobile.push_notification_reply.title'));
|
||||||
@@ -115,7 +115,7 @@ class PushNotifications {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return serverUrl;
|
return serverUrl;
|
||||||
}
|
};
|
||||||
|
|
||||||
handleClearNotification = async (notification: NotificationWithData) => {
|
handleClearNotification = async (notification: NotificationWithData) => {
|
||||||
const {payload} = notification;
|
const {payload} = notification;
|
||||||
@@ -124,7 +124,7 @@ class PushNotifications {
|
|||||||
if (serverUrl && payload?.channel_id) {
|
if (serverUrl && payload?.channel_id) {
|
||||||
markChannelAsViewed(serverUrl, payload?.channel_id, false);
|
markChannelAsViewed(serverUrl, payload?.channel_id, false);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleInAppNotification = async (serverUrl: string, notification: NotificationWithData) => {
|
handleInAppNotification = async (serverUrl: string, notification: NotificationWithData) => {
|
||||||
const {payload} = notification;
|
const {payload} = notification;
|
||||||
@@ -178,7 +178,7 @@ class PushNotifications {
|
|||||||
backgroundNotification(serverUrl, notification);
|
backgroundNotification(serverUrl, notification);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
handleSessionNotification = async (notification: NotificationWithData) => {
|
handleSessionNotification = async (notification: NotificationWithData) => {
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
@@ -189,7 +189,7 @@ class PushNotifications {
|
|||||||
if (serverUrl) {
|
if (serverUrl) {
|
||||||
DeviceEventEmitter.emit(Events.SERVER_LOGOUT, serverUrl);
|
DeviceEventEmitter.emit(Events.SERVER_LOGOUT, serverUrl);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
processNotification = async (notification: NotificationWithData) => {
|
processNotification = async (notification: NotificationWithData) => {
|
||||||
const {payload} = notification;
|
const {payload} = notification;
|
||||||
|
|||||||
@@ -46,13 +46,13 @@ class WebsocketManager {
|
|||||||
|
|
||||||
AppState.addEventListener('change', this.onAppStateChange);
|
AppState.addEventListener('change', this.onAppStateChange);
|
||||||
NetInfo.addEventListener(this.onNetStateChange);
|
NetInfo.addEventListener(this.onNetStateChange);
|
||||||
}
|
};
|
||||||
|
|
||||||
public invalidateClient = (serverUrl: string) => {
|
public invalidateClient = (serverUrl: string) => {
|
||||||
this.clients[serverUrl]?.close();
|
this.clients[serverUrl]?.close();
|
||||||
this.clients[serverUrl]?.invalidate();
|
this.clients[serverUrl]?.invalidate();
|
||||||
delete this.clients[serverUrl];
|
delete this.clients[serverUrl];
|
||||||
}
|
};
|
||||||
|
|
||||||
public createClient = (serverUrl: string, bearerToken: string, storedLastDisconnect = 0) => {
|
public createClient = (serverUrl: string, bearerToken: string, storedLastDisconnect = 0) => {
|
||||||
const client = new WebSocketClient(serverUrl, bearerToken, storedLastDisconnect);
|
const client = new WebSocketClient(serverUrl, bearerToken, storedLastDisconnect);
|
||||||
@@ -70,13 +70,13 @@ class WebsocketManager {
|
|||||||
this.clients[serverUrl] = client;
|
this.clients[serverUrl] = client;
|
||||||
|
|
||||||
return this.clients[serverUrl];
|
return this.clients[serverUrl];
|
||||||
}
|
};
|
||||||
|
|
||||||
public closeAll = () => {
|
public closeAll = () => {
|
||||||
for (const client of Object.values(this.clients)) {
|
for (const client of Object.values(this.clients)) {
|
||||||
client.close(true);
|
client.close(true);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
public openAll = () => {
|
public openAll = () => {
|
||||||
for (const client of Object.values(this.clients)) {
|
for (const client of Object.values(this.clients)) {
|
||||||
@@ -84,21 +84,21 @@ class WebsocketManager {
|
|||||||
client.initialize();
|
client.initialize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
public isConnected = (serverUrl: string): boolean => {
|
public isConnected = (serverUrl: string): boolean => {
|
||||||
return this.clients[serverUrl]?.isConnected();
|
return this.clients[serverUrl]?.isConnected();
|
||||||
}
|
};
|
||||||
|
|
||||||
private onFirstConnect = (serverUrl: string) => {
|
private onFirstConnect = (serverUrl: string) => {
|
||||||
this.startPeriodicStatusUpdates(serverUrl);
|
this.startPeriodicStatusUpdates(serverUrl);
|
||||||
handleFirstConnect(serverUrl);
|
handleFirstConnect(serverUrl);
|
||||||
}
|
};
|
||||||
|
|
||||||
private onReconnect = (serverUrl: string) => {
|
private onReconnect = (serverUrl: string) => {
|
||||||
this.startPeriodicStatusUpdates(serverUrl);
|
this.startPeriodicStatusUpdates(serverUrl);
|
||||||
handleReconnect(serverUrl);
|
handleReconnect(serverUrl);
|
||||||
}
|
};
|
||||||
|
|
||||||
private onWebsocketClose = async (serverUrl: string, connectFailCount: number, lastDisconnect: number) => {
|
private onWebsocketClose = async (serverUrl: string, connectFailCount: number, lastDisconnect: number) => {
|
||||||
if (connectFailCount <= 1) { // First fail
|
if (connectFailCount <= 1) { // First fail
|
||||||
@@ -107,7 +107,7 @@ class WebsocketManager {
|
|||||||
|
|
||||||
this.stopPeriodicStatusUpdates(serverUrl);
|
this.stopPeriodicStatusUpdates(serverUrl);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
private startPeriodicStatusUpdates(serverUrl: string) {
|
private startPeriodicStatusUpdates(serverUrl: string) {
|
||||||
let currentId = this.statusUpdatesIntervalIDs[serverUrl];
|
let currentId = this.statusUpdatesIntervalIDs[serverUrl];
|
||||||
@@ -163,7 +163,7 @@ class WebsocketManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.previousAppState = appState;
|
this.previousAppState = appState;
|
||||||
}
|
};
|
||||||
|
|
||||||
private onNetStateChange = async (netState: NetInfoState) => {
|
private onNetStateChange = async (netState: NetInfoState) => {
|
||||||
const newState = Boolean(netState.isConnected);
|
const newState = Boolean(netState.isConnected);
|
||||||
@@ -179,7 +179,7 @@ class WebsocketManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.closeAll();
|
this.closeAll();
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new WebsocketManager();
|
export default new WebsocketManager();
|
||||||
|
|||||||
@@ -120,7 +120,7 @@ class ClearAfterModal extends NavigationComponent<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
};
|
||||||
|
|
||||||
onDone = () => {
|
onDone = () => {
|
||||||
const {handleClearAfterClick, isModal} = this.props;
|
const {handleClearAfterClick, isModal} = this.props;
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
|
import qs from 'querystring';
|
||||||
|
|
||||||
import React, {useEffect, useState} from 'react';
|
import React, {useEffect, useState} from 'react';
|
||||||
import {useIntl} from 'react-intl';
|
import {useIntl} from 'react-intl';
|
||||||
import {Linking, Platform, Text, View} from 'react-native';
|
import {Linking, Platform, Text, View} from 'react-native';
|
||||||
@@ -74,10 +76,11 @@ const SSOWithRedirectURL = ({doSSOLogin, loginError, loginUrl, serverUrl, setLog
|
|||||||
NetworkManager.createClient(serverUrl);
|
NetworkManager.createClient(serverUrl);
|
||||||
}
|
}
|
||||||
const parsedUrl = urlParse(loginUrl, true);
|
const parsedUrl = urlParse(loginUrl, true);
|
||||||
parsedUrl.set('query', {
|
const query: Record<string, string> = {
|
||||||
...parsedUrl.query,
|
...parsedUrl.query,
|
||||||
redirect_to: redirectUrl,
|
redirect_to: redirectUrl,
|
||||||
});
|
};
|
||||||
|
parsedUrl.set('query', qs.stringify(query));
|
||||||
const url = parsedUrl.toString();
|
const url = parsedUrl.toString();
|
||||||
|
|
||||||
const onError = (e: Error) => {
|
const onError = (e: Error) => {
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ const SSOWithWebView = ({completeUrlPath, doSSOLogin, loginError, loginUrl, serv
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const extractCookie = (parsedUrl: urlParse) => {
|
const extractCookie = (parsedUrl: urlParse<string>) => {
|
||||||
try {
|
try {
|
||||||
const original = urlParse(serverUrl);
|
const original = urlParse(serverUrl);
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ class EphemeralStore {
|
|||||||
navigationComponentIdStack: string[] = [];
|
navigationComponentIdStack: string[] = [];
|
||||||
navigationModalStack: string[] = [];
|
navigationModalStack: string[] = [];
|
||||||
theme: Theme | undefined;
|
theme: Theme | undefined;
|
||||||
visibleTab = 'Home'
|
visibleTab = 'Home';
|
||||||
|
|
||||||
addNavigationComponentId = (componentId: string) => {
|
addNavigationComponentId = (componentId: string) => {
|
||||||
this.addToNavigationComponentIdStack(componentId);
|
this.addToNavigationComponentIdStack(componentId);
|
||||||
@@ -17,7 +17,7 @@ class EphemeralStore {
|
|||||||
if (!this.allNavigationComponentIds.includes(componentId)) {
|
if (!this.allNavigationComponentIds.includes(componentId)) {
|
||||||
this.allNavigationComponentIds.unshift(componentId);
|
this.allNavigationComponentIds.unshift(componentId);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
addToNavigationComponentIdStack = (componentId: string) => {
|
addToNavigationComponentIdStack = (componentId: string) => {
|
||||||
const index = this.navigationComponentIdStack.indexOf(componentId);
|
const index = this.navigationComponentIdStack.indexOf(componentId);
|
||||||
@@ -26,11 +26,11 @@ class EphemeralStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.navigationComponentIdStack.unshift(componentId);
|
this.navigationComponentIdStack.unshift(componentId);
|
||||||
}
|
};
|
||||||
|
|
||||||
addNavigationModal = (componentId: string) => {
|
addNavigationModal = (componentId: string) => {
|
||||||
this.navigationModalStack.unshift(componentId);
|
this.navigationModalStack.unshift(componentId);
|
||||||
}
|
};
|
||||||
|
|
||||||
clearNavigationComponents = () => {
|
clearNavigationComponents = () => {
|
||||||
this.navigationComponentIdStack = [];
|
this.navigationComponentIdStack = [];
|
||||||
@@ -40,21 +40,21 @@ class EphemeralStore {
|
|||||||
|
|
||||||
clearNavigationModals = () => {
|
clearNavigationModals = () => {
|
||||||
this.navigationModalStack = [];
|
this.navigationModalStack = [];
|
||||||
}
|
};
|
||||||
|
|
||||||
getAllNavigationComponents = () => this.allNavigationComponentIds;
|
getAllNavigationComponents = () => this.allNavigationComponentIds;
|
||||||
|
|
||||||
getNavigationTopComponentId = () => {
|
getNavigationTopComponentId = () => {
|
||||||
return this.navigationComponentIdStack[0];
|
return this.navigationComponentIdStack[0];
|
||||||
}
|
};
|
||||||
|
|
||||||
getNavigationTopModalId = () => {
|
getNavigationTopModalId = () => {
|
||||||
return this.navigationModalStack[0];
|
return this.navigationModalStack[0];
|
||||||
}
|
};
|
||||||
|
|
||||||
getNavigationComponents = () => {
|
getNavigationComponents = () => {
|
||||||
return this.navigationComponentIdStack;
|
return this.navigationComponentIdStack;
|
||||||
}
|
};
|
||||||
|
|
||||||
getVisibleTab = () => this.visibleTab;
|
getVisibleTab = () => this.visibleTab;
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ class EphemeralStore {
|
|||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
this.navigationComponentIdStack.splice(index, 1);
|
this.navigationComponentIdStack.splice(index, 1);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
removeNavigationModal = (componentId: string) => {
|
removeNavigationModal = (componentId: string) => {
|
||||||
const index = this.navigationModalStack.indexOf(componentId);
|
const index = this.navigationModalStack.indexOf(componentId);
|
||||||
@@ -73,11 +73,11 @@ class EphemeralStore {
|
|||||||
if (index >= 0) {
|
if (index >= 0) {
|
||||||
this.navigationModalStack.splice(index, 1);
|
this.navigationModalStack.splice(index, 1);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
setVisibleTap = (tab: string) => {
|
setVisibleTap = (tab: string) => {
|
||||||
this.visibleTab = tab;
|
this.visibleTab = tab;
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits until a screen has been mounted and is part of the stack.
|
* Waits until a screen has been mounted and is part of the stack.
|
||||||
@@ -94,7 +94,7 @@ class EphemeralStore {
|
|||||||
|
|
||||||
found = this.navigationComponentIdStack.includes(componentId);
|
found = this.navigationComponentIdStack.includes(componentId);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Waits until a screen has been removed as part of the stack.
|
* Waits until a screen has been removed as part of the stack.
|
||||||
@@ -111,7 +111,7 @@ class EphemeralStore {
|
|||||||
|
|
||||||
found = !this.navigationComponentIdStack.includes(componentId);
|
found = !this.navigationComponentIdStack.includes(componentId);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new EphemeralStore();
|
export default new EphemeralStore();
|
||||||
|
|||||||
3546
detox/package-lock.json
generated
3546
detox/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -4,22 +4,22 @@
|
|||||||
"repository": "git@github.com:mattermost/mattermost-mobile.git",
|
"repository": "git@github.com:mattermost/mattermost-mobile.git",
|
||||||
"author": "Mattermost, Inc.",
|
"author": "Mattermost, Inc.",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/plugin-proposal-class-properties": "7.14.5",
|
"@babel/plugin-proposal-class-properties": "7.16.0",
|
||||||
"@babel/plugin-transform-modules-commonjs": "7.15.4",
|
"@babel/plugin-transform-modules-commonjs": "7.16.0",
|
||||||
"@babel/plugin-transform-runtime": "7.15.0",
|
"@babel/plugin-transform-runtime": "7.16.4",
|
||||||
"@babel/preset-env": "7.15.6",
|
"@babel/preset-env": "7.16.4",
|
||||||
"axios": "0.21.4",
|
"axios": "0.24.0",
|
||||||
"babel-jest": "27.2.1",
|
"babel-jest": "27.3.1",
|
||||||
"babel-plugin-module-resolver": "4.1.0",
|
"babel-plugin-module-resolver": "4.1.0",
|
||||||
"client-oauth2": "github:larkox/js-client-oauth2#e24e2eb5dfcbbbb3a59d095e831dbe0012b0ac49",
|
"client-oauth2": "github:larkox/js-client-oauth2#e24e2eb5dfcbbbb3a59d095e831dbe0012b0ac49",
|
||||||
"deepmerge": "4.2.2",
|
"deepmerge": "4.2.2",
|
||||||
"detox": "18.20.4",
|
"detox": "19.1.0",
|
||||||
"form-data": "4.0.0",
|
"form-data": "4.0.0",
|
||||||
"jest": "27.2.1",
|
"jest": "27.3.1",
|
||||||
"jest-circus": "27.2.1",
|
"jest-circus": "27.3.1",
|
||||||
"jest-cli": "27.2.1",
|
"jest-cli": "27.3.1",
|
||||||
"jest-html-reporters": "2.1.6",
|
"jest-html-reporters": "2.1.6",
|
||||||
"jest-junit": "12.3.0",
|
"jest-junit": "13.0.0",
|
||||||
"sanitize-filename": "1.6.3",
|
"sanitize-filename": "1.6.3",
|
||||||
"uuid": "8.3.2"
|
"uuid": "8.3.2"
|
||||||
},
|
},
|
||||||
|
|||||||
3637
package-lock.json
generated
3637
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
92
package.json
92
package.json
@@ -7,7 +7,7 @@
|
|||||||
"license": "Apache 2.0",
|
"license": "Apache 2.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "7.16.0",
|
"@babel/runtime": "7.16.3",
|
||||||
"@formatjs/intl-datetimeformat": "4.2.5",
|
"@formatjs/intl-datetimeformat": "4.2.5",
|
||||||
"@formatjs/intl-getcanonicallocales": "1.8.0",
|
"@formatjs/intl-getcanonicallocales": "1.8.0",
|
||||||
"@formatjs/intl-locale": "2.4.40",
|
"@formatjs/intl-locale": "2.4.40",
|
||||||
@@ -19,17 +19,17 @@
|
|||||||
"@mattermost/react-native-paste-input": "0.3.4",
|
"@mattermost/react-native-paste-input": "0.3.4",
|
||||||
"@nozbe/watermelondb": "0.24.0",
|
"@nozbe/watermelondb": "0.24.0",
|
||||||
"@nozbe/with-observables": "1.4.0",
|
"@nozbe/with-observables": "1.4.0",
|
||||||
"@react-native-async-storage/async-storage": "1.15.11",
|
"@react-native-async-storage/async-storage": "1.15.13",
|
||||||
"@react-native-community/art": "1.2.0",
|
"@react-native-community/art": "1.2.0",
|
||||||
"@react-native-community/cameraroll": "4.1.2",
|
"@react-native-community/cameraroll": "4.1.2",
|
||||||
"@react-native-community/clipboard": "1.5.1",
|
"@react-native-community/clipboard": "1.5.1",
|
||||||
"@react-native-community/datetimepicker": "3.5.2",
|
"@react-native-community/datetimepicker": "4.0.0",
|
||||||
"@react-native-community/masked-view": "0.1.11",
|
"@react-native-community/masked-view": "0.1.11",
|
||||||
"@react-native-community/netinfo": "6.0.6",
|
"@react-native-community/netinfo": "7.1.2",
|
||||||
"@react-native-cookies/cookies": "6.0.11",
|
"@react-native-cookies/cookies": "6.0.11",
|
||||||
"@react-navigation/bottom-tabs": "6.0.9",
|
"@react-navigation/bottom-tabs": "6.0.9",
|
||||||
"@react-navigation/native": "6.0.6",
|
"@react-navigation/native": "6.0.6",
|
||||||
"@rudderstack/rudder-sdk-react-native": "1.0.15",
|
"@rudderstack/rudder-sdk-react-native": "1.1.0",
|
||||||
"@sentry/react-native": "3.2.3",
|
"@sentry/react-native": "3.2.3",
|
||||||
"@types/mime-db": "1.43.1",
|
"@types/mime-db": "1.43.1",
|
||||||
"commonmark": "0.30.0",
|
"commonmark": "0.30.0",
|
||||||
@@ -37,20 +37,21 @@
|
|||||||
"deep-equal": "2.0.5",
|
"deep-equal": "2.0.5",
|
||||||
"deepmerge": "4.2.2",
|
"deepmerge": "4.2.2",
|
||||||
"emoji-regex": "10.0.0",
|
"emoji-regex": "10.0.0",
|
||||||
|
"expo": "43.0.3",
|
||||||
"fuse.js": "6.4.6",
|
"fuse.js": "6.4.6",
|
||||||
"jail-monkey": "2.6.0",
|
"jail-monkey": "2.6.0",
|
||||||
"lottie-ios": "3.2.3",
|
"lottie-ios": "3.2.3",
|
||||||
"lottie-react-native": "4.1.3",
|
"lottie-react-native": "5.0.1",
|
||||||
"mime-db": "1.50.0",
|
"mime-db": "1.51.0",
|
||||||
"moment-timezone": "0.5.33",
|
"moment-timezone": "0.5.34",
|
||||||
"prop-types": "15.7.2",
|
"prop-types": "15.7.2",
|
||||||
"react": "17.0.2",
|
"react": "17.0.2",
|
||||||
"react-intl": "5.21.0",
|
"react-intl": "5.22.0",
|
||||||
"react-native": "0.66.2",
|
"react-native": "0.66.3",
|
||||||
"react-native-android-open-settings": "1.3.0",
|
"react-native-android-open-settings": "1.3.0",
|
||||||
"react-native-button": "3.0.1",
|
"react-native-button": "3.0.1",
|
||||||
"react-native-calendars": "1.1268.0",
|
"react-native-calendars": "1.1269.0",
|
||||||
"react-native-device-info": "8.4.5",
|
"react-native-device-info": "8.4.8",
|
||||||
"react-native-document-picker": "7.1.1",
|
"react-native-document-picker": "7.1.1",
|
||||||
"react-native-elements": "3.4.2",
|
"react-native-elements": "3.4.2",
|
||||||
"react-native-exception-handler": "2.10.10",
|
"react-native-exception-handler": "2.10.10",
|
||||||
@@ -64,39 +65,39 @@
|
|||||||
"react-native-keychain": "8.0.0",
|
"react-native-keychain": "8.0.0",
|
||||||
"react-native-linear-gradient": "2.5.6",
|
"react-native-linear-gradient": "2.5.6",
|
||||||
"react-native-localize": "2.1.5",
|
"react-native-localize": "2.1.5",
|
||||||
"react-native-navigation": "7.23.1",
|
"react-native-navigation": "7.23.1-hotfix.1",
|
||||||
"react-native-neomorph-shadows": "1.1.2",
|
"react-native-neomorph-shadows": "1.1.2",
|
||||||
"react-native-notifications": "4.1.2",
|
"react-native-notifications": "4.1.2",
|
||||||
"react-native-permissions": "3.1.0",
|
"react-native-permissions": "3.1.0",
|
||||||
"react-native-reanimated": "2.2.3",
|
"react-native-reanimated": "2.2.4",
|
||||||
"react-native-redash": "16.2.2",
|
"react-native-redash": "16.2.3",
|
||||||
"react-native-safe-area-context": "3.3.2",
|
"react-native-safe-area-context": "3.3.2",
|
||||||
"react-native-screens": "3.9.0",
|
"react-native-screens": "3.9.0",
|
||||||
"react-native-section-list-get-item-layout": "2.2.3",
|
"react-native-section-list-get-item-layout": "2.2.3",
|
||||||
"react-native-share": "7.2.1",
|
"react-native-share": "7.3.0",
|
||||||
"react-native-slider": "0.11.0",
|
"react-native-slider": "0.11.0",
|
||||||
"react-native-svg": "12.1.1",
|
"react-native-svg": "12.1.1",
|
||||||
"react-native-vector-icons": "9.0.0",
|
"react-native-vector-icons": "9.0.0",
|
||||||
"react-native-video": "5.2.0",
|
"react-native-video": "5.2.0",
|
||||||
"react-native-webview": "11.14.2",
|
"react-native-webview": "11.15.0",
|
||||||
"react-native-youtube": "2.0.2",
|
"react-native-youtube": "2.0.2",
|
||||||
"reanimated-bottom-sheet": "1.0.0-alpha.22",
|
"reanimated-bottom-sheet": "1.0.0-alpha.22",
|
||||||
"rn-placeholder": "3.0.3",
|
"rn-placeholder": "3.0.3",
|
||||||
"semver": "7.3.5",
|
"semver": "7.3.5",
|
||||||
"serialize-error": "8.1.0",
|
"serialize-error": "9.0.0",
|
||||||
"shallow-equals": "1.0.0",
|
"shallow-equals": "1.0.0",
|
||||||
"tinycolor2": "1.4.2",
|
"tinycolor2": "1.4.2",
|
||||||
"url-parse": "1.5.3",
|
"url-parse": "1.5.3"
|
||||||
"expo": ">=43.0.0-* <44.0.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "7.16.0",
|
"@babel/cli": "7.16.0",
|
||||||
"@babel/core": "7.16.0",
|
"@babel/core": "7.16.0",
|
||||||
|
"@babel/eslint-parser": "7.16.3",
|
||||||
"@babel/plugin-proposal-class-properties": "7.16.0",
|
"@babel/plugin-proposal-class-properties": "7.16.0",
|
||||||
"@babel/plugin-proposal-decorators": "7.16.0",
|
"@babel/plugin-proposal-decorators": "7.16.4",
|
||||||
"@babel/plugin-transform-flow-strip-types": "7.16.0",
|
"@babel/plugin-transform-flow-strip-types": "7.16.0",
|
||||||
"@babel/plugin-transform-runtime": "7.16.0",
|
"@babel/plugin-transform-runtime": "7.16.4",
|
||||||
"@babel/preset-env": "7.16.0",
|
"@babel/preset-env": "7.16.4",
|
||||||
"@babel/preset-typescript": "7.16.0",
|
"@babel/preset-typescript": "7.16.0",
|
||||||
"@babel/register": "7.16.0",
|
"@babel/register": "7.16.0",
|
||||||
"@react-native-community/eslint-config": "3.0.1",
|
"@react-native-community/eslint-config": "3.0.1",
|
||||||
@@ -104,35 +105,33 @@
|
|||||||
"@types/commonmark": "0.27.5",
|
"@types/commonmark": "0.27.5",
|
||||||
"@types/commonmark-react-renderer": "4.3.1",
|
"@types/commonmark-react-renderer": "4.3.1",
|
||||||
"@types/deep-equal": "1.0.1",
|
"@types/deep-equal": "1.0.1",
|
||||||
"@types/jest": "27.0.2",
|
"@types/jest": "27.0.3",
|
||||||
"@types/lodash": "4.14.176",
|
"@types/lodash": "4.14.177",
|
||||||
"@types/react": "17.0.34",
|
"@types/react": "17.0.37",
|
||||||
"@types/react-intl": "3.0.0",
|
"@types/react-native": "0.66.6",
|
||||||
"@types/react-native": "0.66.2",
|
|
||||||
"@types/react-native-button": "3.0.1",
|
"@types/react-native-button": "3.0.1",
|
||||||
"@types/react-native-share": "3.3.3",
|
"@types/react-native-share": "3.3.3",
|
||||||
"@types/react-native-video": "5.0.10",
|
"@types/react-native-video": "5.0.11",
|
||||||
"@types/react-test-renderer": "17.0.1",
|
"@types/react-test-renderer": "17.0.1",
|
||||||
"@types/semver": "7.3.9",
|
"@types/semver": "7.3.9",
|
||||||
"@types/shallow-equals": "1.0.0",
|
"@types/shallow-equals": "1.0.0",
|
||||||
"@types/tinycolor2": "1.4.3",
|
"@types/tinycolor2": "1.4.3",
|
||||||
"@types/url-parse": "1.4.4",
|
"@types/url-parse": "1.4.5",
|
||||||
"@typescript-eslint/eslint-plugin": "5.3.0",
|
"@typescript-eslint/eslint-plugin": "5.4.0",
|
||||||
"@typescript-eslint/parser": "5.3.0",
|
"@typescript-eslint/parser": "5.4.0",
|
||||||
"babel-eslint": "10.1.0",
|
|
||||||
"babel-jest": "27.3.1",
|
"babel-jest": "27.3.1",
|
||||||
"babel-loader": "8.2.3",
|
"babel-loader": "8.2.3",
|
||||||
"babel-plugin-module-resolver": "4.1.0",
|
"babel-plugin-module-resolver": "4.1.0",
|
||||||
"babel-plugin-transform-remove-console": "6.9.4",
|
"babel-plugin-transform-remove-console": "6.9.4",
|
||||||
"deep-freeze": "0.0.1",
|
"deep-freeze": "0.0.1",
|
||||||
"detox": "19.0.0",
|
"detox": "19.1.0",
|
||||||
"eslint": "7.32.0",
|
"eslint": "8.3.0",
|
||||||
"eslint-plugin-header": "3.1.1",
|
"eslint-plugin-header": "3.1.1",
|
||||||
"eslint-plugin-import": "2.25.2",
|
"eslint-plugin-import": "2.25.3",
|
||||||
"eslint-plugin-jest": "25.2.3",
|
"eslint-plugin-jest": "25.3.0",
|
||||||
"eslint-plugin-mattermost": "github:mattermost/eslint-plugin-mattermost#46ad99355644a719bf32082f472048f526605181",
|
"eslint-plugin-mattermost": "github:mattermost/eslint-plugin-mattermost#23abcf9988f7fa00d26929f11841aab7ccb16b2b",
|
||||||
"eslint-plugin-react": "7.26.1",
|
"eslint-plugin-react": "7.27.1",
|
||||||
"eslint-plugin-react-hooks": "4.2.0",
|
"eslint-plugin-react-hooks": "4.3.0",
|
||||||
"husky": "7.0.4",
|
"husky": "7.0.4",
|
||||||
"isomorphic-fetch": "3.0.0",
|
"isomorphic-fetch": "3.0.0",
|
||||||
"jest": "27.3.1",
|
"jest": "27.3.1",
|
||||||
@@ -141,7 +140,7 @@
|
|||||||
"metro-react-native-babel-preset": "0.66.2",
|
"metro-react-native-babel-preset": "0.66.2",
|
||||||
"mmjstool": "github:mattermost/mattermost-utilities#519b99a4e51e6c67a0dbd46a6efdff27dc835aaa",
|
"mmjstool": "github:mattermost/mattermost-utilities#519b99a4e51e6c67a0dbd46a6efdff27dc835aaa",
|
||||||
"mock-async-storage": "2.2.0",
|
"mock-async-storage": "2.2.0",
|
||||||
"nock": "13.1.4",
|
"nock": "13.2.1",
|
||||||
"patch-package": "6.4.7",
|
"patch-package": "6.4.7",
|
||||||
"react-native-dev-menu": "4.0.2",
|
"react-native-dev-menu": "4.0.2",
|
||||||
"react-native-dotenv": "3.3.0",
|
"react-native-dotenv": "3.3.0",
|
||||||
@@ -149,7 +148,7 @@
|
|||||||
"react-native-svg-transformer": "0.14.3",
|
"react-native-svg-transformer": "0.14.3",
|
||||||
"react-test-renderer": "17.0.2",
|
"react-test-renderer": "17.0.2",
|
||||||
"ts-jest": "27.0.7",
|
"ts-jest": "27.0.7",
|
||||||
"typescript": "4.4.4",
|
"typescript": "4.5.2",
|
||||||
"underscore": "1.13.1",
|
"underscore": "1.13.1",
|
||||||
"util": "0.12.4"
|
"util": "0.12.4"
|
||||||
},
|
},
|
||||||
@@ -194,7 +193,14 @@
|
|||||||
},
|
},
|
||||||
"expo": {
|
"expo": {
|
||||||
"autolinking": {
|
"autolinking": {
|
||||||
"exclude": ["expo-keep-awake", "expo-font", "expo-constants", "expo-application", "expo-assets", "expo-error-recovery"]
|
"exclude": [
|
||||||
|
"expo-keep-awake",
|
||||||
|
"expo-font",
|
||||||
|
"expo-constants",
|
||||||
|
"expo-application",
|
||||||
|
"expo-assets",
|
||||||
|
"expo-error-recovery"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
26
patches/react-native-reanimated+2.2.4.patch
Normal file
26
patches/react-native-reanimated+2.2.4.patch
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
diff --git a/node_modules/react-native-reanimated/lib/reanimated2/js-reanimated/index.web.js b/node_modules/react-native-reanimated/lib/reanimated2/js-reanimated/index.web.js
|
||||||
|
index 4ab9d7e..67b2060 100644
|
||||||
|
--- a/node_modules/react-native-reanimated/lib/reanimated2/js-reanimated/index.web.js
|
||||||
|
+++ b/node_modules/react-native-reanimated/lib/reanimated2/js-reanimated/index.web.js
|
||||||
|
@@ -11,7 +11,7 @@ export const _updatePropsJS = (_viewTag, _viewName, updates, viewRef) => {
|
||||||
|
acc[index][key] = value;
|
||||||
|
return acc;
|
||||||
|
}, [{}, {}]);
|
||||||
|
- setNativeProps(viewRef._component, rawStyles);
|
||||||
|
+ setNativeProps(viewRef.current._component, rawStyles);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const setNativeProps = (component, style) => {
|
||||||
|
diff --git a/node_modules/react-native-reanimated/src/reanimated2/js-reanimated/index.web.ts b/node_modules/react-native-reanimated/src/reanimated2/js-reanimated/index.web.ts
|
||||||
|
index 46de206..58126f2 100644
|
||||||
|
--- a/node_modules/react-native-reanimated/src/reanimated2/js-reanimated/index.web.ts
|
||||||
|
+++ b/node_modules/react-native-reanimated/src/reanimated2/js-reanimated/index.web.ts
|
||||||
|
@@ -18,7 +18,7 @@ export const _updatePropsJS = (_viewTag, _viewName, updates, viewRef) => {
|
||||||
|
[{}, {}]
|
||||||
|
);
|
||||||
|
|
||||||
|
- setNativeProps(viewRef._component, rawStyles);
|
||||||
|
+ setNativeProps(viewRef.current._component, rawStyles);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
@@ -62,7 +62,7 @@ class TestHelper {
|
|||||||
await operator.batchRecords(systems);
|
await operator.batchRecords(systems);
|
||||||
|
|
||||||
return {database, operator};
|
return {database, operator};
|
||||||
}
|
};
|
||||||
|
|
||||||
activateMocking() {
|
activateMocking() {
|
||||||
if (!nock.isActive()) {
|
if (!nock.isActive()) {
|
||||||
@@ -128,7 +128,7 @@ class TestHelper {
|
|||||||
id: this.generateId(),
|
id: this.generateId(),
|
||||||
delete_at: 0,
|
delete_at: 0,
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
fakeChannelMember = (userId, channelId) => {
|
fakeChannelMember = (userId, channelId) => {
|
||||||
return {
|
return {
|
||||||
@@ -289,26 +289,6 @@ class TestHelper {
|
|||||||
update_at: 1507840900004,
|
update_at: 1507840900004,
|
||||||
delete_at: 0,
|
delete_at: 0,
|
||||||
};
|
};
|
||||||
}
|
|
||||||
|
|
||||||
generateId = () => {
|
|
||||||
// Implementation taken from http://stackoverflow.com/a/2117523
|
|
||||||
let id = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';
|
|
||||||
|
|
||||||
id = id.replace(/[xy]/g, (c) => {
|
|
||||||
const r = Math.floor(Math.random() * 16);
|
|
||||||
|
|
||||||
let v;
|
|
||||||
if (c === 'x') {
|
|
||||||
v = r;
|
|
||||||
} else {
|
|
||||||
v = (r & 0x3) | 0x8;
|
|
||||||
}
|
|
||||||
|
|
||||||
return v.toString(16);
|
|
||||||
});
|
|
||||||
|
|
||||||
return 'uid' + id;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
mockLogin = () => {
|
mockLogin = () => {
|
||||||
@@ -331,7 +311,7 @@ class TestHelper {
|
|||||||
nock(this.basicClient4.getBaseRoute()).
|
nock(this.basicClient4.getBaseRoute()).
|
||||||
get('/users/me/preferences').
|
get('/users/me/preferences').
|
||||||
reply(200, [{user_id: this.basicUser.id, category: 'tutorial_step', name: this.basicUser.id, value: '999'}]);
|
reply(200, [{user_id: this.basicUser.id, category: 'tutorial_step', name: this.basicUser.id, value: '999'}]);
|
||||||
}
|
};
|
||||||
|
|
||||||
initMockEntities = () => {
|
initMockEntities = () => {
|
||||||
this.basicUser = this.fakeUserWithId();
|
this.basicUser = this.fakeUserWithId();
|
||||||
@@ -410,7 +390,7 @@ class TestHelper {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
this.basicScheme = this.mockSchemeWithId();
|
this.basicScheme = this.mockSchemeWithId();
|
||||||
}
|
};
|
||||||
|
|
||||||
initBasic = async (client = this.createClient()) => {
|
initBasic = async (client = this.createClient()) => {
|
||||||
client.setUrl(Config.TestServerUrl || Config.DefaultServerUrl);
|
client.setUrl(Config.TestServerUrl || Config.DefaultServerUrl);
|
||||||
@@ -481,7 +461,7 @@ class TestHelper {
|
|||||||
description: '',
|
description: '',
|
||||||
content_type: 'application/x-www-form-urlencoded',
|
content_type: 'application/x-www-form-urlencoded',
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
testCommand = (teamId) => {
|
testCommand = (teamId) => {
|
||||||
return {
|
return {
|
||||||
@@ -514,9 +494,9 @@ class TestHelper {
|
|||||||
this.basicChannel = null;
|
this.basicChannel = null;
|
||||||
this.basicChannelMember = null;
|
this.basicChannelMember = null;
|
||||||
this.basicPost = null;
|
this.basicPost = null;
|
||||||
}
|
};
|
||||||
|
|
||||||
wait = (time) => new Promise((resolve) => setTimeout(resolve, time))
|
wait = (time) => new Promise((resolve) => setTimeout(resolve, time));
|
||||||
}
|
}
|
||||||
|
|
||||||
export default new TestHelper();
|
export default new TestHelper();
|
||||||
|
|||||||
Reference in New Issue
Block a user