Clear channel feed on logout

This commit is contained in:
WardPearce
2026-02-14 04:12:41 +13:00
parent f324f0960f
commit 18124eddc2
2 changed files with 13 additions and 4 deletions
@@ -142,6 +142,10 @@ export async function parseChannelRSS(channelId: string): Promise<void> {
}
}
export async function clearFeedYTjs() {
await localDb.subscriptionFeed.clear();
}
export async function getFeedYTjs(maxResults: number, page: number): Promise<Feed> {
let channelSubscriptions: ChannelSubscriptions[];
+9 -4
View File
@@ -44,6 +44,7 @@
import Author from '$lib/components/Author.svelte';
import Toast from '$lib/components/Toast.svelte';
import { isOwnBackend } from '$lib/shared';
import { clearFeedYTjs } from '$lib/api/youtubejs/subscriptions';
let { children } = $props();
@@ -187,10 +188,14 @@
loginError = true;
}
function logout() {
if (isOwnBackend()?.internalAuth && isYTBackend()) {
rawMasterKeyStore.set(undefined);
fetch('/api/user/logout', { method: 'DELETE' });
async function logout() {
if (isYTBackend()) {
await clearFeedYTjs();
if (isOwnBackend()?.internalAuth) {
rawMasterKeyStore.set(undefined);
fetch('/api/user/logout', { method: 'DELETE' });
}
}
authStore.set(null);