pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

basic febbox + backend handling

preparing for backend v2

Pas 48b5ed71 2ca64a6b

+19 -2
+2
src/backend/accounts/settings.ts
··· 8 8 applicationTheme?: string | null; 9 9 defaultSubtitleLanguage?: string; 10 10 proxyUrls?: string[] | null; 11 + febboxKey?: string | null; 11 12 } 12 13 13 14 export interface SettingsResponse { ··· 15 16 applicationLanguage?: string | null; 16 17 defaultSubtitleLanguage?: string | null; 17 18 proxyUrls?: string[] | null; 19 + febboxKey?: string | null; 18 20 } 19 21 20 22 export function updateSettings(
+3 -1
src/hooks/auth/useAuthData.ts
··· 28 28 const importSubtitleLanguage = useSubtitleStore( 29 29 (s) => s.importSubtitleLanguage, 30 30 ); 31 + const setFebboxToken = useAuthStore((s) => s.setFebboxToken); 31 32 32 33 const replaceBookmarks = useBookmarkStore((s) => s.replaceBookmarks); 33 34 const replaceItems = useProgressStore((s) => s.replaceItems); ··· 57 58 removeAccount(); 58 59 clearBookmarks(); 59 60 clearProgress(); 60 - }, [removeAccount, clearBookmarks, clearProgress]); 61 + setFebboxToken(null); 62 + }, [removeAccount, clearBookmarks, clearProgress, setFebboxToken]); 61 63 62 64 const syncData = useCallback( 63 65 async (
+14 -1
src/pages/Settings.tsx
··· 9 9 encryptData, 10 10 } from "@/backend/accounts/crypto"; 11 11 import { getSessions, updateSession } from "@/backend/accounts/sessions"; 12 - import { updateSettings } from "@/backend/accounts/settings"; 12 + import { getSettings, updateSettings } from "@/backend/accounts/settings"; 13 13 import { editUser } from "@/backend/accounts/user"; 14 14 import { getAllProviders } from "@/backend/providers/providers"; 15 15 import { Button } from "@/components/buttons/Button"; ··· 175 175 const { logout } = useAuth(); 176 176 const user = useAuthStore(); 177 177 178 + useEffect(() => { 179 + const loadSettings = async () => { 180 + if (account && backendUrl) { 181 + const settings = await getSettings(backendUrl, account); 182 + if (settings.febboxKey) { 183 + setFebboxToken(settings.febboxKey); 184 + } 185 + } 186 + }; 187 + loadSettings(); 188 + }, [account, backendUrl, setFebboxToken]); 189 + 178 190 const state = useSettingsState( 179 191 activeTheme, 180 192 appLanguage, ··· 241 253 applicationLanguage: state.appLanguage.state, 242 254 applicationTheme: state.theme.state, 243 255 proxyUrls: state.proxyUrls.state?.filter((v) => v !== "") ?? null, 256 + febboxKey: state.febboxToken.state, 244 257 }); 245 258 } 246 259 if (state.deviceName.changed) {