Skip to content

Commit

Permalink
feat(local-users-map): update current user map with logic to include …
Browse files Browse the repository at this point in the history
…display sub handle (zid or wallet) (#2203)
  • Loading branch information
domw30 authored Aug 24, 2024
1 parent af3bc8a commit a90e016
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/store/messages/saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { NotifiableEventType } from '../../lib/chat/matrix/types';
import { mapAdminUserIdToZeroUserId } from '../channels-list/utils';
import { ChatMessageEvents, getChatMessageBus } from './messages';
import { decryptFile } from '../../lib/chat/matrix/media';
import { getUserSubHandle } from '../../lib/user';

export interface Payload {
channelId: string;
Expand Down Expand Up @@ -94,13 +95,15 @@ export function* getLocalZeroUsersMap() {
}
// map current user as well
const currentUser = yield select(currentUserSelector());
const displaySubHandle = getUserSubHandle(currentUser?.primaryZID, currentUser?.primaryWalletAddress);
if (currentUser) {
zeroUsersMap[currentUser.matrixId] = {
userId: currentUser.id,
profileId: currentUser.profileSummary.id,
firstName: currentUser.profileSummary.firstName,
lastName: currentUser.profileSummary.lastName,
profileImage: currentUser.profileSummary.profileImage,
displaySubHandle,
} as User;
}

Expand Down

0 comments on commit a90e016

Please sign in to comment.