feat: add option to disable post feed virtualization
This commit is contained in:
1 parent
345d4a7366
commit
4797e5ca64
7 files changed
+26
-22
No files matched your search
@@ -47,15 +47,7 @@
|
||||
{:else}
|
||||
{#each combinedPosts as post, index}
|
||||
{#if !($userSettings.hidePosts.deleted && post.post.deleted) && !($userSettings.hidePosts.removed && post.post.removed)}
|
||||
<li
|
||||
in:fly|global={{
|
||||
y: -8,
|
||||
duration: 500,
|
||||
opacity: 0,
|
||||
delay: 100 + index * 20,
|
||||
}}
|
||||
class="relative post-container"
|
||||
>
|
||||
<li class="relative post-container">
|
||||
<Post
|
||||
hideCommunity={community}
|
||||
view={(post.post.featured_community || post.post.featured_local) &&
|
||||
|
||||
@@ -799,6 +799,10 @@
|
||||
"debug": {
|
||||
"title": "Debug info",
|
||||
"description": "Display debug information"
|
||||
},
|
||||
"virtualizeFeeds": {
|
||||
"title": "Don't virtualize feeds",
|
||||
"description": "Virtualization only renders visible posts, increasing performance drastically. Disable virtualization if you are having stutter problems. This will disable infinite scroll."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -33,7 +33,7 @@ export async function postFeed(args: {
|
||||
const feed = get(postFeeds)[args.id]
|
||||
|
||||
const posts = shouldReload(feed, args.url, get(instance))
|
||||
? await client({ func: fetch }).getPosts(args.request)
|
||||
? await client({ func: args.fetch }).getPosts(args.request)
|
||||
: feed.data.posts
|
||||
|
||||
if (shouldReload(feed, args.url, get(instance)) && browser)
|
||||
|
||||
+3
-1
@@ -92,6 +92,7 @@ interface Settings {
|
||||
deduplicateEmbed: boolean
|
||||
compactFeatured: boolean
|
||||
showHidden: boolean
|
||||
noVirtualize: boolean
|
||||
}
|
||||
infiniteScroll: boolean
|
||||
language: string | null
|
||||
@@ -105,7 +106,7 @@ interface Settings {
|
||||
}
|
||||
|
||||
export const defaultSettings: Settings = {
|
||||
settingsVer: 1,
|
||||
settingsVer: 2,
|
||||
expandableImages: toBool(env.PUBLIC_EXPANDABLE_IMAGES) ?? true,
|
||||
markReadPosts: toBool(env.PUBLIC_MARK_READ_POSTS) ?? true,
|
||||
showInstances: {
|
||||
@@ -171,6 +172,7 @@ export const defaultSettings: Settings = {
|
||||
deduplicateEmbed: toBool(env.PUBLIC_DEDUPLICATE_EMBED) ?? true,
|
||||
compactFeatured: toBool(env.PUBLIC_COMPACT_FEATURED) ?? true,
|
||||
showHidden: false,
|
||||
noVirtualize: false,
|
||||
},
|
||||
infiniteScroll: true,
|
||||
language: env.PUBLIC_LANGUAGE ?? null,
|
||||
|
||||
Reference in new issue
Block a user