Skip to content

Commit

Permalink
MOBILE-4362 comments: Fix delete button displayed when it shouldn't
Browse files Browse the repository at this point in the history
The show delete button icon now also changes so it's clearer that something happened, otherwise if you cannot delete any of the comments you see it could seem that the button does nothing
  • Loading branch information
dpalou committed Oct 11, 2023
1 parent 1a44478 commit 6d80cd6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/core/components/message/message.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
<ion-icon *ngIf="message.pending" name="fas-clock" [attr.aria-label]="'core.notsent' | translate" role="status"></ion-icon>
</div>

<ion-button *ngIf="showDelete && !message.deleted && message.delete !== false" fill="clear" [@coreSlideInOut]="'fromRight'"
color="danger" (click)="delete($event)" [attr.aria-label]="'addon.messages.deletemessage' | translate" class="delete-button">
<ion-button *ngIf="showDelete && !message.deleted && message.delete" fill="clear" [@coreSlideInOut]="'fromRight'" color="danger"
(click)="delete($event)" [attr.aria-label]="'addon.messages.deletemessage' | translate" class="delete-button">
<ion-icon name="fas-trash" slot="icon-only" aria-hidden="true"></ion-icon>
</ion-button>
<ion-button *ngIf="showDelete && message.deleted" fill="clear" color="danger" (click)="undoDelete($event)"
[attr.aria-label]="'core.restore' | translate" class="delete-button">
<ion-button *ngIf="showDelete && message.deleted" fill="clear" [@coreSlideInOut]="'fromRight'" color="danger"
(click)="undoDelete($event)" [attr.aria-label]="'core.restore' | translate" class="delete-button">
<ion-icon name="fas-rotate-left" slot="icon-only" aria-hidden="true"></ion-icon>
</ion-button>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/core/features/comments/pages/viewer/viewer.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ <h1>
<ion-buttons slot="end">
<ion-button *ngIf="canDeleteComments" slot="end" fill="clear" (click)="toggleDelete()"
[attr.aria-label]="'core.toggledelete' | translate">
<ion-icon name="fas-pen" slot="icon-only" aria-hidden="true"></ion-icon>
<ion-icon *ngIf="!showDelete" name="fas-pen" slot="icon-only" aria-hidden="true"></ion-icon>
<ion-icon *ngIf="showDelete" name="fas-check" slot="icon-only" aria-hidden="true"></ion-icon>
</ion-button>
<core-context-menu>
<core-context-menu-item [hidden]="!(commentsLoaded && !hasOffline)" [priority]="100" [content]="'core.refresh' | translate"
Expand Down

0 comments on commit 6d80cd6

Please sign in to comment.