MOBILE-3320 messages: Fix undefined on discussion 3.4

main
Pau Ferrer Ocaña 2021-06-01 12:04:01 +02:00
parent 94205791b5
commit a8021bdf63
4 changed files with 13 additions and 6 deletions

View File

@ -92,12 +92,16 @@
[@coreSlideInOut]="message.useridfrom == currentUserId ? '' : 'fromLeft'"> [@coreSlideInOut]="message.useridfrom == currentUserId ? '' : 'fromLeft'">
<ion-label> <ion-label>
<!-- User data. --> <!-- User data. -->
<div class="item-heading addon-message-user" [attr.aria-label]="message.useridfrom == currentUserId ? <div *ngIf="message.showUserData" class="item-heading addon-message-user">
('addon.messages.you' | translate) : members[message.useridfrom].fullname">
<core-user-avatar slot="start" [user]="members[message.useridfrom]" [linkProfile]="false" <core-user-avatar slot="start" [user]="members[message.useridfrom]" [linkProfile]="false"
*ngIf="message.showUserData"></core-user-avatar> aria-hidden="true">
</core-user-avatar>
<div *ngIf="message.showUserData">{{ members[message.useridfrom].fullname }}</div> {{ members[message.useridfrom].fullname }}
</div>
<div *ngIf="!message.showUserData" class="sr-only">
{{ message.useridfrom == currentUserId
? ('addon.messages.you' | translate)
: members[message.useridfrom].fullname }}
</div> </div>
<!-- Some messages have <p> and some others don't. Add a <p> so they all have same styles. --> <!-- Some messages have <p> and some others don't. Add a <p> so they all have same styles. -->

View File

@ -250,6 +250,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
this.title = user.fullname; this.title = user.fullname;
} }
this.conversationImage = user.profileimageurl; this.conversationImage = user.profileimageurl;
this.members[user.id] = <AddonMessagesConversationMember>user;
return; return;
}).catch(() => { }).catch(() => {

View File

@ -19,7 +19,7 @@
<core-search-box *ngIf="search.enabled" (onSubmit)="searchMessage($event)" (onClear)="clearSearch()" <core-search-box *ngIf="search.enabled" (onSubmit)="searchMessage($event)" (onClear)="clearSearch()"
[placeholder]=" 'addon.messages.message' | translate" autocorrect="off" spellcheck="false" lengthCheck="2" [placeholder]=" 'addon.messages.message' | translate" autocorrect="off" spellcheck="false" lengthCheck="2"
[disabled]="!loaded" searchArea="AddonMessagesDiscussions"></core-search-box> [disabled]="!loaded" searchArea="AddonMessagesDiscussions" [autoFocus]="false"></core-search-box>
<core-loading [hideUntil]="loaded" [message]="loadingMessage"> <core-loading [hideUntil]="loaded" [message]="loadingMessage">

View File

@ -185,6 +185,8 @@ ion-header ion-toolbar {
// Ionic icon. // Ionic icon.
ion-icon { ion-icon {
position: relative;
&.icon-slash::after, &.icon-slash::after,
&.icon-backslash::after { &.icon-backslash::after {
content: " "; content: " ";