From 8785172ae5618ab8b77fc30df8e59ebdc99aab1b Mon Sep 17 00:00:00 2001 From: Xylight Date: Sat, 20 Jul 2024 14:46:57 -0700 Subject: [PATCH] misc: restore <0.19.4 support --- .../lemmy/post/feed/VirtualFeed.svelte | 6 ++- src/lib/version.ts | 4 +- src/routes/profile/+layout.svelte | 52 ++++++++++--------- 3 files changed, 35 insertions(+), 27 deletions(-) diff --git a/src/lib/components/lemmy/post/feed/VirtualFeed.svelte b/src/lib/components/lemmy/post/feed/VirtualFeed.svelte index e5c8950e..6704e309 100644 --- a/src/lib/components/lemmy/post/feed/VirtualFeed.svelte +++ b/src/lib/components/lemmy/post/feed/VirtualFeed.svelte @@ -62,7 +62,7 @@ }) afterNavigate(() => { - $virtualizer.scrollToIndex($postFeeds[feedId].lastSeen ?? 0) + $virtualizer.scrollToIndex($postFeeds[feedId]?.lastSeen ?? 0) }) export let feedData: PostFeed['data'] @@ -122,7 +122,9 @@ if (!id) return - $postFeeds[feedId].lastSeen = Number(id) + postFeeds.updateFeed(feedId, { + lastSeen: Number(id), + }) observer.unobserve(element) }) } diff --git a/src/lib/version.ts b/src/lib/version.ts index 2c866792..c5f52ce4 100644 --- a/src/lib/version.ts +++ b/src/lib/version.ts @@ -9,6 +9,8 @@ const FEATURES = { hidePosts: '0.19.4', altText: '0.19.4', customThumbnail: '0.19.4', + mediaAndVotes: '0.19.4', + distinguishComments: '0.19.4', } type Feature = keyof typeof FEATURES @@ -19,7 +21,7 @@ type Feature = keyof typeof FEATURES export const feature = (feature: Feature, version: string = '0.0.0'): boolean => versionIsSupported(version, FEATURES[feature]) -export const MINIMUM_VERSION = '0.19.4' +export const MINIMUM_VERSION = '0.19.0' export const MAXIMUM_VERSION = '0.999' export const versionIsSupported = (v: string, minimum: string) => { diff --git a/src/routes/profile/+layout.svelte b/src/routes/profile/+layout.svelte index 4fd2d8ba..6d5d41c8 100644 --- a/src/routes/profile/+layout.svelte +++ b/src/routes/profile/+layout.svelte @@ -5,7 +5,9 @@ import MultiSelect from '$lib/components/input/Switch.svelte' import Tabs from '$lib/components/ui/layout/pages/Tabs.svelte' import { contentPadding } from '$lib/components/ui/layout/Shell.svelte' + import { site } from '$lib/lemmy' import { t } from '$lib/translations' + import { feature } from '$lib/version' import { Button, Menu, MenuButton } from 'mono-svelte' import { ArrowDown, @@ -49,33 +51,35 @@ }, ]} /> - - - - - {$t('routes.profile.media.title')} - - - - {$t('routes.profile.upvoted')} - - - - {$t('routes.profile.downvoted')} - - + > + + + + + {$t('routes.profile.media.title')} + + + + {$t('routes.profile.upvoted')} + + + + {$t('routes.profile.downvoted')} + + + {/if}