This commit is contained in:
Xyphyn committed 2023-09-27 16:21:13 -07:00
1 parent 1214b35b29
commit 51b6fe1b4d
3 files changed
+15 -2

No files matched your search

+2
View File
@@ -70,6 +70,7 @@ interface Settings {
hidePhoton: boolean
newWidth: boolean
markPostsAsRead: boolean
}
export const defaultSettings: Settings = {
@@ -116,6 +117,7 @@ export const defaultSettings: Settings = {
leftAlign: false,
hidePhoton: toBool(env.PUBLIC_REMOVE_CREDIT) ?? false,
newWidth: true,
markPostsAsRead: true,
}
export const userSettings = writable(defaultSettings)
@@ -30,16 +30,20 @@
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
import { Button } from 'mono-svelte'
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
import { userSettings } from '$lib/settings.js'
export let data
let post = data.post
onMount(async () => {
if (!post.post_view.read && $profile?.jwt) {
if (
!(post.post_view.read && $userSettings.markPostsAsRead) &&
$profile?.jwt
) {
getClient().markPostAsRead({
auth: $profile.jwt,
read: true,
read: $userSettings.markPostsAsRead,
post_id: post.post_view.post.id,
})
}
+7
View File
@@ -143,6 +143,13 @@
</Setting>
<SectionTitle class="mt-4" id="posts">Posts</SectionTitle>
<Setting>
<span slot="title">Mark read posts</span>
<span slot="description">Mark a post as read when you click on it.</span>
<Checkbox bind:checked={$userSettings.markPostsAsRead}>
{$userSettings.markPostsAsRead ? 'Enabled' : 'Disabled'}
</Checkbox>
</Setting>
<Setting>
<span slot="title">Fade read posts</span>
<span slot="description">