Reorganize state models for clarity (#378)

This commit is contained in:
Paul Frazee 2023-04-03 15:21:17 -05:00 committed by GitHub
parent 9652d994dd
commit 2045c615a8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
44 changed files with 163 additions and 171 deletions

View file

@ -2,7 +2,7 @@ import {LikelyType, LinkMeta} from './link-meta'
// import {match as matchRoute} from 'view/routes'
import {convertBskyAppUrlIfNeeded, makeRecordUri} from '../strings/url-helpers'
import {RootStoreModel} from 'state/index'
import {PostThreadViewModel} from 'state/models/post-thread-view'
import {PostThreadModel} from 'state/models/content/post-thread'
import {ComposerOptsQuote} from 'state/models/ui/shell'
// TODO
@ -108,7 +108,7 @@ export async function getPostAsQuote(
const [_0, user, _1, rkey] = url.split('/').filter(Boolean)
const threadUri = makeRecordUri(user, 'app.bsky.feed.post', rkey)
const threadView = new PostThreadViewModel(store, {
const threadView = new PostThreadModel(store, {
uri: threadUri,
depth: 0,
})

View file

@ -1,7 +1,7 @@
import notifee, {EventType} from '@notifee/react-native'
import {AppBskyEmbedImages} from '@atproto/api'
import {RootStoreModel} from 'state/models/root-store'
import {NotificationsViewItemModel} from 'state/models/notifications-view'
import {NotificationsFeedItemModel} from 'state/models/feeds/notifications'
import {enforceLen} from 'lib/strings/helpers'
import {resetToTab} from '../Navigation'
@ -40,7 +40,7 @@ export function displayNotification(
}
export function displayNotificationFromModel(
notif: NotificationsViewItemModel,
notif: NotificationsFeedItemModel,
) {
let author = notif.author.displayName || notif.author.handle
let title: string