Clear channel feed on logout
This commit is contained in:
@@ -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[];
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user