misc: restore <0.19.4 support

This commit is contained in:
Xylight committed 2024-07-20 14:46:57 -07:00
1 parent 7305ee6e0c
commit 8785172ae5
3 files changed
+11 -3

No files matched your search

@@ -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)
})
}
+3 -1
View File
@@ -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) => {
+4
View File
@@ -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,6 +51,7 @@
},
]}
/>
{#if feature('mediaAndVotes', $site?.version)}
<Menu class="flex-1" placement="bottom-end">
<Button
title={$t('post.actions.more.label')}
@@ -76,6 +79,7 @@
{$t('routes.profile.downvoted')}
</MenuButton>
</Menu>
{/if}
</div>
<slot />
</div>