fix(auth): await push token deletion before clearing API state on logout

The DELETE request for removing the push token was not awaited,
causing a race condition where setApi(null) could execute while
the request was still in flight. This ensures proper sequencing.
This commit is contained in:
Fredrik Burmester
2026-01-05 21:28:00 +01:00
parent 4c8dfa0e2f
commit e0c408452d

View File

@@ -289,7 +289,7 @@ export const JellyfinProvider: React.FC<{ children: ReactNode }> = ({
const logoutMutation = useMutation({
mutationFn: async () => {
api
await api
?.delete(`/Streamyfin/device/${deviceId}`)
.then((_r) => writeInfoLog("Deleted expo push token for device"))
.catch((_e) =>