about summary refs log tree commit diff
path: root/src/state/models/notifications-view.ts
diff options
context:
space:
mode:
authorPaul Frazee <pfrazee@gmail.com>2023-01-17 10:11:30 -0600
committerGitHub <noreply@github.com>2023-01-17 10:11:30 -0600
commitbf1092ad86ef8e5829db29a17f33380dabab8535 (patch)
tree5cf0d18a88d7162fcfe258aff89d3d868268d0d9 /src/state/models/notifications-view.ts
parent5abcc8e336b3af11a6c98d0d9e662415856478a0 (diff)
downloadvoidsky-bf1092ad86ef8e5829db29a17f33380dabab8535.tar.zst
Remove scenes (#36)
* Remove scenes from the main menu

* Remove scenes from the profile view

* Remove 'scenes explainer' from onboarding flow

* Remove scene-related modals

* Remove member/membership code

* Remove all scenes-related items from notifications

* Remove scene-related code from posts feed

* Remove scene-related API helpers

* Update tests
Diffstat (limited to 'src/state/models/notifications-view.ts')
-rw-r--r--src/state/models/notifications-view.ts29
1 files changed, 3 insertions, 26 deletions
diff --git a/src/state/models/notifications-view.ts b/src/state/models/notifications-view.ts
index c169a995c..c4d2b2dfa 100644
--- a/src/state/models/notifications-view.ts
+++ b/src/state/models/notifications-view.ts
@@ -4,17 +4,15 @@ import {
   AppBskyActorRef as ActorRef,
   AppBskyFeedPost,
   AppBskyFeedRepost,
-  AppBskyFeedTrend,
   AppBskyFeedVote,
   AppBskyGraphAssertion,
   AppBskyGraphFollow,
-  APP_BSKY_GRAPH,
 } from '@atproto/api'
 import {RootStoreModel} from './root-store'
 import {PostThreadViewModel} from './post-thread-view'
 import {cleanError} from '../../lib/strings'
 
-const UNGROUPABLE_REASONS = ['trend', 'assertion']
+const UNGROUPABLE_REASONS = ['assertion']
 const PAGE_SIZE = 30
 const MS_60MIN = 1e3 * 60 * 60
 
@@ -27,7 +25,6 @@ export interface GroupedNotification extends ListNotifications.Notification {
 type SupportedRecord =
   | AppBskyFeedPost.Record
   | AppBskyFeedRepost.Record
-  | AppBskyFeedTrend.Record
   | AppBskyFeedVote.Record
   | AppBskyGraphAssertion.Record
   | AppBskyGraphFollow.Record
@@ -94,10 +91,6 @@ export class NotificationsViewItemModel {
     return this.reason === 'repost'
   }
 
-  get isTrend() {
-    return this.reason === 'trend'
-  }
-
   get isMention() {
     return this.reason === 'mention'
   }
@@ -115,26 +108,12 @@ export class NotificationsViewItemModel {
   }
 
   get needsAdditionalData() {
-    if (
-      this.isUpvote ||
-      this.isRepost ||
-      this.isTrend ||
-      this.isReply ||
-      this.isMention
-    ) {
+    if (this.isUpvote || this.isRepost || this.isReply || this.isMention) {
       return !this.additionalPost
     }
     return false
   }
 
-  get isInvite() {
-    return (
-      this.isAssertion &&
-      AppBskyGraphAssertion.isRecord(this.record) &&
-      this.record.assertion === APP_BSKY_GRAPH.AssertMember
-    )
-  }
-
   get subjectUri(): string {
     if (this.reasonSubject) {
       return this.reasonSubject
@@ -142,7 +121,6 @@ export class NotificationsViewItemModel {
     const record = this.record
     if (
       AppBskyFeedRepost.isRecord(record) ||
-      AppBskyFeedTrend.isRecord(record) ||
       AppBskyFeedVote.isRecord(record)
     ) {
       return record.subject.uri
@@ -154,7 +132,6 @@ export class NotificationsViewItemModel {
     for (const ns of [
       AppBskyFeedPost,
       AppBskyFeedRepost,
-      AppBskyFeedTrend,
       AppBskyFeedVote,
       AppBskyGraphAssertion,
       AppBskyGraphFollow,
@@ -185,7 +162,7 @@ export class NotificationsViewItemModel {
     let postUri
     if (this.isReply || this.isMention) {
       postUri = this.uri
-    } else if (this.isUpvote || this.isRepost || this.isTrend) {
+    } else if (this.isUpvote || this.isRepost) {
       postUri = this.subjectUri
     }
     if (postUri) {