mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 15:48:05 +00:00
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:
@@ -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) =>
|
||||
|
||||
Reference in New Issue
Block a user