Remove scene-related code from posts feed
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
|||||||
AppBskyFeedGetAuthorFeed as GetAuthorFeed,
|
AppBskyFeedGetAuthorFeed as GetAuthorFeed,
|
||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
type FeedViewPost = AppBskyFeedFeedViewPost.Main
|
type FeedViewPost = AppBskyFeedFeedViewPost.Main
|
||||||
type ReasonTrend = AppBskyFeedFeedViewPost.ReasonTrend
|
|
||||||
type ReasonRepost = AppBskyFeedFeedViewPost.ReasonRepost
|
type ReasonRepost = AppBskyFeedFeedViewPost.ReasonRepost
|
||||||
type PostView = AppBskyFeedPost.View
|
type PostView = AppBskyFeedPost.View
|
||||||
import {AtUri} from '../../third-party/uri'
|
import {AtUri} from '../../third-party/uri'
|
||||||
@@ -93,12 +92,6 @@ export class FeedItemModel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get reasonTrend(): ReasonTrend | undefined {
|
|
||||||
if (this.reason?.$type === 'app.bsky.feed.feedViewPost#reasonTrend') {
|
|
||||||
return this.reason as ReasonTrend
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async toggleUpvote() {
|
async toggleUpvote() {
|
||||||
const wasUpvoted = !!this.post.viewer.upvote
|
const wasUpvoted = !!this.post.viewer.upvote
|
||||||
const wasDownvoted = !!this.post.viewer.downvote
|
const wasDownvoted = !!this.post.viewer.downvote
|
||||||
@@ -492,10 +485,9 @@ export class FeedModel {
|
|||||||
private _updateAll(res: GetTimeline.Response | GetAuthorFeed.Response) {
|
private _updateAll(res: GetTimeline.Response | GetAuthorFeed.Response) {
|
||||||
for (const item of res.data.feed) {
|
for (const item of res.data.feed) {
|
||||||
const existingItem = this.feed.find(
|
const existingItem = this.feed.find(
|
||||||
// HACK: need to find the reposts and trends item, so we have to check for that -prf
|
// HACK: need to find the reposts' item, so we have to check for that -prf
|
||||||
item2 =>
|
item2 =>
|
||||||
item.post.uri === item2.post.uri &&
|
item.post.uri === item2.post.uri &&
|
||||||
item.reason?.$trend === item2.reason?.$trend &&
|
|
||||||
// @ts-ignore todo
|
// @ts-ignore todo
|
||||||
item.reason?.by?.did === item2.reason?.by?.did,
|
item.reason?.by?.did === item2.reason?.by?.did,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -146,23 +146,6 @@ export const FeedItem = observer(function ({
|
|||||||
</Text>
|
</Text>
|
||||||
</Link>
|
</Link>
|
||||||
)}
|
)}
|
||||||
{item.reasonTrend && (
|
|
||||||
<Link
|
|
||||||
style={styles.includeReason}
|
|
||||||
href={`/profile/${item.reasonTrend.by.handle}`}
|
|
||||||
title={
|
|
||||||
item.reasonTrend.by.displayName || item.reasonTrend.by.handle
|
|
||||||
}>
|
|
||||||
<FontAwesomeIcon
|
|
||||||
icon="arrow-trend-up"
|
|
||||||
style={styles.includeReasonIcon}
|
|
||||||
/>
|
|
||||||
<Text type="overline2" style={{color: pal.colors.actionLabel}}>
|
|
||||||
Trending with{' '}
|
|
||||||
{item.reasonTrend.by.displayName || item.reasonTrend.by.handle}
|
|
||||||
</Text>
|
|
||||||
</Link>
|
|
||||||
)}
|
|
||||||
<View style={styles.layout}>
|
<View style={styles.layout}>
|
||||||
<View style={styles.layoutAvi}>
|
<View style={styles.layoutAvi}>
|
||||||
<Link href={authorHref} title={item.post.author.handle}>
|
<Link href={authorHref} title={item.post.author.handle}>
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import {faArrowRightFromBracket} from '@fortawesome/free-solid-svg-icons'
|
|||||||
import {faArrowUpFromBracket} from '@fortawesome/free-solid-svg-icons/faArrowUpFromBracket'
|
import {faArrowUpFromBracket} from '@fortawesome/free-solid-svg-icons/faArrowUpFromBracket'
|
||||||
import {faArrowUpRightFromSquare} from '@fortawesome/free-solid-svg-icons/faArrowUpRightFromSquare'
|
import {faArrowUpRightFromSquare} from '@fortawesome/free-solid-svg-icons/faArrowUpRightFromSquare'
|
||||||
import {faArrowsRotate} from '@fortawesome/free-solid-svg-icons/faArrowsRotate'
|
import {faArrowsRotate} from '@fortawesome/free-solid-svg-icons/faArrowsRotate'
|
||||||
import {faArrowTrendUp} from '@fortawesome/free-solid-svg-icons/faArrowTrendUp'
|
|
||||||
import {faAt} from '@fortawesome/free-solid-svg-icons/faAt'
|
import {faAt} from '@fortawesome/free-solid-svg-icons/faAt'
|
||||||
import {faBars} from '@fortawesome/free-solid-svg-icons/faBars'
|
import {faBars} from '@fortawesome/free-solid-svg-icons/faBars'
|
||||||
import {faBell} from '@fortawesome/free-solid-svg-icons/faBell'
|
import {faBell} from '@fortawesome/free-solid-svg-icons/faBell'
|
||||||
@@ -81,7 +80,6 @@ export function setup() {
|
|||||||
faArrowUpFromBracket,
|
faArrowUpFromBracket,
|
||||||
faArrowUpRightFromSquare,
|
faArrowUpRightFromSquare,
|
||||||
faArrowsRotate,
|
faArrowsRotate,
|
||||||
faArrowTrendUp,
|
|
||||||
faAt,
|
faAt,
|
||||||
faBars,
|
faBars,
|
||||||
faBell,
|
faBell,
|
||||||
|
|||||||
Reference in New Issue
Block a user