added poll support in notifications

This commit is contained in:
Nicolas Constant 2019-06-13 20:57:05 -04:00
parent ba4fa61667
commit 83258ed553
No known key found for this signature in database
GPG Key ID: 1E9F677FB01A5688
4 changed files with 13 additions and 3 deletions

View File

@ -154,6 +154,7 @@ class NotificationWrapper {
case 'mention':
case 'reblog':
case 'favourite':
case 'poll':
this.status= new StatusWrapper(notification.status, provider);
break;
}
@ -164,5 +165,5 @@ class NotificationWrapper {
wrapperId: string;
account: Account;
status: StatusWrapper;
type: 'mention' | 'reblog' | 'favourite' | 'follow';
type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll';
}

View File

@ -21,6 +21,14 @@
innerHTML="{{ notificationAccount | accountEmoji }}"></a> boosted your status
</div>
</div>
<div *ngIf="notificationType === 'poll'">
<div class="notification--icon">
<fa-icon class="boost" [icon]="faList"></fa-icon>
</div>
<div class="notification--label">
A poll you have voted in has ended
</div>
</div>
<div class="status">
<div [ngClass]="{'notification--status': notificationAccount }">
<a href class="status__profile-link" title="{{displayedStatus.account.acct}}"

View File

@ -1,5 +1,5 @@
import { Component, OnInit, Input, Output, EventEmitter, ViewChild } from "@angular/core";
import { faStar, faRetweet } from "@fortawesome/free-solid-svg-icons";
import { faStar, faRetweet, faList } from "@fortawesome/free-solid-svg-icons";
import { Status, Account } from "../../../services/models/mastodon.interfaces";
import { OpenThreadEvent, ToolsService } from "../../../services/tools.service";
@ -17,6 +17,7 @@ export class StatusComponent implements OnInit {
faStar = faStar;
faRetweet = faRetweet;
faList = faList;
displayedStatus: Status;

View File

@ -124,7 +124,7 @@ export interface Mention {
export interface Notification {
id: string;
type: 'mention' | 'reblog' | 'favourite' | 'follow';
type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll';
created_at: string;
account: Account;
status?: Status;