Skip to content

Commit

Permalink
fix: signalr not connecting on logout and re-login (#867)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshithmohan authored Apr 13, 2024
1 parent 4d0412d commit 921eac6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/middlewares/signalr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
HttpTransportType,
type HubConnection,
HubConnectionBuilder,
HubConnectionState,
JsonHubProtocol,
LogLevel,
} from '@microsoft/signalr';
Expand Down Expand Up @@ -106,7 +107,9 @@ next =>
async (action: UnknownAction) => {
// register signalR after the user logged in
if (action.type === Events.MAINPAGE_LOADED) {
if (connectionEvents !== undefined) return next(action);
if (connectionEvents !== undefined && connectionEvents.state !== HubConnectionState.Disconnected) {
return next(action);
}
const connectionHub = '/signalr/aggregate?feeds=anidb,shoko,queue,network,avdump';

const protocol = new JsonHubProtocol();
Expand Down

0 comments on commit 921eac6

Please sign in to comment.