[Gekidou] multi server fixes (#6102)

This commit is contained in:
Elias Nahum 2022-03-30 08:04:58 -03:00 committed by GitHub
parent 29628a585f
commit a058eddb21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 6 deletions

View file

@ -286,7 +286,7 @@ export const fetchMissingSidebarInfo = async (serverUrl: string, directChannels:
if (data.users.length > 1) {
displayNameByChannel[data.channelId] = displayGroupMessageName(data.users, locale, teammateDisplayNameSetting, currentUserId);
} else {
displayNameByChannel[data.channelId] = displayUsername(data.users[0], locale, teammateDisplayNameSetting);
displayNameByChannel[data.channelId] = displayUsername(data.users[0], locale, teammateDisplayNameSetting, false);
}
}
});

View file

@ -79,7 +79,7 @@ export const appEntry = async (serverUrl: string, since = 0) => {
const {id: currentUserId, locale: currentUserLocale} = meData.user || (await getCurrentUser(database))!;
const {config, license} = await getCommonSystemValues(database);
deferredAppEntryActions(serverUrl, lastDisconnectedAt, currentUserId, currentUserLocale, prefData.preferences, config, license, teamData, chData, initialTeamId);
await deferredAppEntryActions(serverUrl, lastDisconnectedAt, currentUserId, currentUserLocale, prefData.preferences, config, license, teamData, chData, initialTeamId);
if (!since) {
// Load data from other servers

View file

@ -137,7 +137,7 @@ export const pushNotificationEntry = async (serverUrl: string, notification: Not
const {id: currentUserId, locale: currentUserLocale} = meData.user || (await getCurrentUser(operator.database))!;
const {config, license} = await getCommonSystemValues(operator.database);
deferredAppEntryActions(serverUrl, lastDisconnectedAt, currentUserId, currentUserLocale, prefData.preferences, config, license, teamData, chData, selectedTeamId, selectedChannelId);
await deferredAppEntryActions(serverUrl, lastDisconnectedAt, currentUserId, currentUserLocale, prefData.preferences, config, license, teamData, chData, selectedTeamId, selectedChannelId);
syncOtherServers(serverUrl);
const error = teamData.error || chData?.error || prefData.error || meData.error;
return {error, userId: meData?.user?.id};

View file

@ -43,7 +43,7 @@ export const transformChannelRecord = ({action, database, value}: TransformerArg
// for DM & GM's channels do not override the display name
// until we get the new info if there is any
let displayName;
if (raw.type === General.DM_CHANNEL && record?.displayName) {
if (raw.type === General.DM_CHANNEL && (record?.displayName || raw.display_name)) {
displayName = raw.display_name || record?.displayName;
} else if (raw.type === General.GM_CHANNEL) {
const rawMembers = raw.display_name.split(',').length;

View file

@ -33,7 +33,7 @@ export const getAllServerCredentials = async (): Promise<ServerCredential[]> =>
export const getActiveServerUrl = async () => {
let serverUrl = await DatabaseManager.getActiveServerUrl();
if (serverUrl) {
if (!serverUrl) {
let serverUrls: string[];
if (Platform.OS === 'ios') {
serverUrls = await KeyChain.getAllInternetPasswordServers();

View file

@ -40,7 +40,7 @@ export function displayGroupMessageName(users: Array<UserProfile | UserModel>, l
users.forEach((u) => {
if (u.id !== excludeUserId) {
names.push(displayUsername(u, locale, teammateDisplayNameSetting));
names.push(displayUsername(u, locale, teammateDisplayNameSetting, false));
}
});