Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
fix(posts): rename 'thing' to something actually appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
jpezninjo committed Oct 31, 2023
1 parent e8a6aa1 commit 8538808
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions components/status/StatusActions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import { engagementDetails } from '~~/telemetry/engagementDetails'
const props = defineProps<{
status: mastodon.v1.Status
thing?: string
feedName?: string
details?: boolean
command?: boolean
}>()
const focusEditor = inject<typeof noop>('focus-editor', noop)
const { details, command, thing } = $(props)
const { details, command, feedName } = $(props)
const userSettings = useUserSettings()
const useStarFavoriteIcon = usePreferences('useStarFavoriteIcon')
Expand All @@ -27,7 +27,7 @@ const {
} = $(useStatusActions(props))
function recordEngagement(engagementAction: String) {
const analyticsId = thing ? `${thing}.post.${engagementAction}` : `post.${engagementAction}`
const analyticsId = feedName ? `${feedName}.post.${engagementAction}` : `post.${engagementAction}`
engagement.record({ ui_identifier: analyticsId, mastodon_status_id: status.id, ...engagementDetails[analyticsId] })
}
Expand Down
6 changes: 3 additions & 3 deletions components/status/StatusActionsMore.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ const props = defineProps<{
status: mastodon.v1.Status
details?: boolean
command?: boolean
thing: string
feedName: string
}>()
const emit = defineEmits<{
(event: 'afterEdit'): void
}>()
const { details, command, thing } = $(props)
const { details, command, feedName } = $(props)
const {
status,
Expand Down Expand Up @@ -125,7 +125,7 @@ function showFavoritedAndBoostedBy() {
}
function report() {
const analyticsId = thing ? `${thing}.post.report` : 'post.report'
const analyticsId = feedName ? `${feedName}.post.report` : 'post.report'
engagement.record({ ui_identifier: analyticsId, mastodon_status_id: status.id, ...engagementDetails[analyticsId] })
openReportDialog(status.account, status)
Expand Down
6 changes: 3 additions & 3 deletions components/status/StatusCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const props = withDefaults(
hover?: boolean
inNotification?: boolean
isPreview?: boolean
thing: string
feedName: string
// If we know the prev and next status in the timeline, we can simplify the card
older?: mastodon.v1.Status
Expand Down Expand Up @@ -172,7 +172,7 @@ const forceShow = ref(false)
</div>
</div>
</div>
<StatusActionsMore v-if="actions !== false" :status="status" me--2 :thing="thing" />
<StatusActionsMore v-if="actions !== false" :status="status" me--2 :feed-name="feedName" />
</div>

<!-- Content -->
Expand All @@ -184,7 +184,7 @@ const forceShow = ref(false)
:in-notification="inNotification"
mb2 :class="{ 'mt-2 mb1': isDM }"
/>
<StatusActions v-if="actions !== false" v-show="!getPreferences(userSettings, 'zenMode')" :status="status" :thing="thing" />
<StatusActions v-if="actions !== false" v-show="!getPreferences(userSettings, 'zenMode')" :status="status" :feed-name="feedName" />
</div>
</template>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/timeline/TimelineBookmarks.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ const paginator = useMastoClient().v1.bookmarks.list()
</script>

<template>
<TimelinePaginator end-message="common.no_bookmarks" :paginator="paginator" thing="bookmarks.feed" />
<TimelinePaginator end-message="common.no_bookmarks" :paginator="paginator" feed-name="bookmarks.feed" />
</template>
2 changes: 1 addition & 1 deletion components/timeline/TimelineFavourites.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ const paginator = useMastoClient().v1.favourites.list()
</script>

<template>
<TimelinePaginator end-message="common.no_favourites" :paginator="paginator" thing="favorites.feed" />
<TimelinePaginator end-message="common.no_favourites" :paginator="paginator" feed-name="favorites.feed" />
</template>
2 changes: 1 addition & 1 deletion components/timeline/TimelineHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ function onPublish(status) {
<template>
<div>
<PublishWidget draft-key="home" border="b base" @published="onPublish" />
<TimelinePaginator ref="homePaginator" v-bind="{ paginator, stream }" :preprocess="reorderAndFilter" context="home" thing="home.feed" />
<TimelinePaginator ref="homePaginator" v-bind="{ paginator, stream }" :preprocess="reorderAndFilter" context="home" feed-name="home.feed" />
</div>
</template>
6 changes: 3 additions & 3 deletions components/timeline/TimelinePaginator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const { paginator, stream, account, buffer = 10, endMessage = true } = definePro
preprocess?: (items: mastodon.v1.Status[]) => mastodon.v1.Status[]
buffer?: number
endMessage?: boolean | string
thing: string
feedName: string
}>()
const commonPaginator = ref(null)
Expand Down Expand Up @@ -44,11 +44,11 @@ const showOriginSite = $computed(() =>
<template #default="{ item, older, newer, active }">
<template v-if="virtualScroller">
<DynamicScrollerItem :item="item" :active="active" tag="article">
<StatusCard :status="item" :context="context" :older="older" :newer="newer" :thing="thing" />
<StatusCard :status="item" :context="context" :older="older" :newer="newer" :feed-name="feedName" />
</DynamicScrollerItem>
</template>
<template v-else>
<StatusCard :status="item" :context="context" :older="older" :newer="newer" :thing="thing" />
<StatusCard :status="item" :context="context" :older="older" :newer="newer" :feed-name="feedName" />
</template>
</template>
<template v-if="context === 'account' " #done="{ items }">
Expand Down
2 changes: 1 addition & 1 deletion components/timeline/TimelinePublic.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ function reorderAndFilter(items: mastodon.v1.Status[]) {

<template>
<div>
<TimelinePaginator v-bind="{ paginator, stream }" :preprocess="reorderAndFilter" context="public" thing="federated.feed" />
<TimelinePaginator v-bind="{ paginator, stream }" :preprocess="reorderAndFilter" context="public" feed-name="federated.feed" />
</div>
</template>
2 changes: 1 addition & 1 deletion components/timeline/TimelinePublicLocal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ const stream = useStreaming(client => client.v1.stream.streamCommunityTimeline()

<template>
<div>
<TimelinePaginator v-bind="{ paginator, stream }" context="public" thing="local.feed" />
<TimelinePaginator v-bind="{ paginator, stream }" context="public" feed-name="local.feed" />
</div>
</template>

0 comments on commit 8538808

Please sign in to comment.