Fix update own DM display name

This commit is contained in:
Elias Nahum 2022-05-24 17:38:12 -04:00
parent d1c9c98900
commit fe5b034915
No known key found for this signature in database
GPG key ID: E038DB71E0B61702

View file

@ -480,6 +480,7 @@ export async function fetchMissingDirectChannelsInfo(serverUrl: string, directCh
const ownDirectChannel = dms.find((dm) => dm.name === getDirectChannelName(currentUserId, currentUserId));
if (ownDirectChannel) {
ownDirectChannel.display_name = displayUsername(currentUser, locale, teammateDisplayNameSetting, false);
updatedChannels.add(ownDirectChannel);
}
}
}
@ -487,7 +488,7 @@ export async function fetchMissingDirectChannelsInfo(serverUrl: string, directCh
const updatedChannelsArray = Array.from(updatedChannels);
if (!fetchOnly) {
const modelPromises: Array<Promise<Model[]>> = [];
if (users.length) {
if (updatedChannelsArray.length) {
modelPromises.push(operator.handleChannel({channels: updatedChannelsArray, prepareRecordsOnly: true}));
}