disable notification on unsupported type
This commit is contained in:
parent
982a670352
commit
84a4b8c00a
|
@ -82,7 +82,7 @@ export class MentionsComponent extends TimelineBase {
|
|||
}
|
||||
|
||||
protected getNextStatuses(): Promise<Status[]> {
|
||||
return this.mastodonService.getNotifications(this.account, ['follow', 'favourite', 'reblog', 'poll', 'move'], this.lastId)
|
||||
return this.mastodonService.getNotifications(this.account, ['follow', 'favourite', 'reblog', 'poll', 'move', 'update'], this.lastId)
|
||||
.then((result: Notification[]) => {
|
||||
const statuses = result.map(x => x.status);
|
||||
|
||||
|
|
|
@ -101,7 +101,7 @@ export class NotificationsComponent extends BrowseBase {
|
|||
this.isLoading = true;
|
||||
this.isProcessingInfiniteScroll = true;
|
||||
|
||||
this.mastodonService.getNotifications(this.account.info, ['mention'], this.lastId)
|
||||
this.mastodonService.getNotifications(this.account.info, ['mention', 'update'], this.lastId)
|
||||
.then((notifications: Notification[]) => {
|
||||
if (notifications.length === 0) {
|
||||
this.maxReached = true;
|
||||
|
@ -168,5 +168,5 @@ export class NotificationWrapper {
|
|||
account: Account;
|
||||
target: Account;
|
||||
status: StatusWrapper;
|
||||
type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll' | 'follow_request' | 'move';
|
||||
type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll' | 'follow_request' | 'move' | 'update';
|
||||
}
|
|
@ -126,7 +126,7 @@ export class StreamNotificationsComponent extends BrowseBase {
|
|||
this.loadMentions(userNotifications);
|
||||
});
|
||||
|
||||
this.mastodonService.getNotifications(this.account, null, null, null, 10)
|
||||
this.mastodonService.getNotifications(this.account, ['update'], null, null, 10) //FIXME: disable edition update until supported
|
||||
.then((notifications: Notification[]) => {
|
||||
this.isNotificationsLoading = false;
|
||||
|
||||
|
@ -201,7 +201,7 @@ export class StreamNotificationsComponent extends BrowseBase {
|
|||
|
||||
this.isNotificationsLoading = true;
|
||||
|
||||
this.mastodonService.getNotifications(this.account, null, this.lastNotificationId)
|
||||
this.mastodonService.getNotifications(this.account, ['update'], this.lastNotificationId)
|
||||
.then((result: Notification[]) => {
|
||||
if (result.length === 0) {
|
||||
this.notificationsMaxReached = true;
|
||||
|
@ -235,7 +235,7 @@ export class StreamNotificationsComponent extends BrowseBase {
|
|||
|
||||
this.isMentionsLoading = true;
|
||||
|
||||
this.mastodonService.getNotifications(this.account, ['follow', 'favourite', 'reblog', 'poll', 'follow_request', 'move'], this.lastMentionId)
|
||||
this.mastodonService.getNotifications(this.account, ['follow', 'favourite', 'reblog', 'poll', 'follow_request', 'move', 'update'], this.lastMentionId)
|
||||
.then((result: Notification[]) => {
|
||||
if (result.length === 0) {
|
||||
this.mentionsMaxReached = true;
|
||||
|
|
|
@ -309,7 +309,7 @@ export class MastodonWrapperService {
|
|||
});
|
||||
}
|
||||
|
||||
getNotifications(account: AccountInfo, excludeTypes: ('follow' | 'favourite' | 'reblog' | 'mention' | 'poll' | 'follow_request' | 'move')[] = null, maxId: string = null, sinceId: string = null, limit: number = 15): Promise<Notification[]> {
|
||||
getNotifications(account: AccountInfo, excludeTypes: ('follow' | 'favourite' | 'reblog' | 'mention' | 'poll' | 'follow_request' | 'move' | 'update')[] = null, maxId: string = null, sinceId: string = null, limit: number = 15): Promise<Notification[]> {
|
||||
return this.refreshAccountIfNeeded(account)
|
||||
.then((refreshedAccount: AccountInfo) => {
|
||||
return this.mastodonService.getNotifications(refreshedAccount, excludeTypes, maxId, sinceId, limit);
|
||||
|
|
|
@ -378,7 +378,7 @@ export class MastodonService {
|
|||
return this.httpClient.put<Attachment>(route, input, { headers: headers }).toPromise();
|
||||
}
|
||||
|
||||
getNotifications(account: AccountInfo, excludeTypes: ('follow' | 'favourite' | 'reblog' | 'mention' | 'poll' | 'follow_request' | 'move')[] = null, maxId: string = null, sinceId: string = null, limit: number = 15): Promise<Notification[]> {
|
||||
getNotifications(account: AccountInfo, excludeTypes: ('follow' | 'favourite' | 'reblog' | 'mention' | 'poll' | 'follow_request' | 'move' | 'update')[] = null, maxId: string = null, sinceId: string = null, limit: number = 15): Promise<Notification[]> {
|
||||
let route = `https://${account.instance}${this.apiRoutes.getNotifications}?limit=${limit}`;
|
||||
|
||||
if (maxId) {
|
||||
|
|
|
@ -156,7 +156,7 @@ export interface Mention {
|
|||
|
||||
export interface Notification {
|
||||
id: string;
|
||||
type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll' | 'follow_request' | 'move';
|
||||
type: 'mention' | 'reblog' | 'favourite' | 'follow' | 'poll' | 'follow_request' | 'move' | 'update';
|
||||
created_at: string;
|
||||
account: Account;
|
||||
status?: Status;
|
||||
|
|
|
@ -96,7 +96,7 @@ export class StreamingWrapper {
|
|||
}
|
||||
|
||||
private pullNewNotifications() {
|
||||
this.mastodonService.getNotifications(this.account, null, null, this.since_id_notifications, 10)
|
||||
this.mastodonService.getNotifications(this.account, ['update'], null, this.since_id_notifications, 10)
|
||||
.then((notifications: Notification[]) => {
|
||||
//notifications = notifications.sort((a, b) => a.id.localeCompare(b.id));
|
||||
let soundMuted = !this.since_id_notifications;
|
||||
|
@ -168,6 +168,10 @@ export class StreamingWrapper {
|
|||
newUpdate.type = EventEnum.unknow;
|
||||
}
|
||||
|
||||
if(newUpdate.notification && newUpdate.notification.type === 'update') { //FIXME: disabling edition update until supported
|
||||
return;
|
||||
}
|
||||
|
||||
this.statusUpdateSubjet.next(newUpdate);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ export class UserNotificationService {
|
|||
}
|
||||
|
||||
private startFetchingNotifications(account: AccountInfo) {
|
||||
let getMentionsPromise = this.mastodonService.getNotifications(account, ['favourite', 'follow', 'reblog', 'poll', 'follow_request', 'move'], null, null, 10)
|
||||
let getMentionsPromise = this.mastodonService.getNotifications(account, ['favourite', 'follow', 'reblog', 'poll', 'follow_request', 'move', 'update'], null, null, 10)
|
||||
.then((notifications: Notification[]) => {
|
||||
this.processMentionsAndNotifications(account, notifications, NotificationTypeEnum.UserMention);
|
||||
})
|
||||
|
@ -66,7 +66,7 @@ export class UserNotificationService {
|
|||
this.notificationService.notifyHttpError(err, account);
|
||||
});
|
||||
|
||||
let getNotificationPromise = this.mastodonService.getNotifications(account, ['mention'], null, null, 10)
|
||||
let getNotificationPromise = this.mastodonService.getNotifications(account, ['mention', 'update'], null, null, 10)
|
||||
.then((notifications: Notification[]) => {
|
||||
this.processMentionsAndNotifications(account, notifications, NotificationTypeEnum.UserNotification);
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue