Signed-off-by: Timo K <toger5@hotmail.de>
This commit is contained in:
Timo K
2023-06-12 10:14:11 +02:00
parent d4d7518c40
commit 532dddcb2b
3 changed files with 10 additions and 14 deletions

View File

@@ -73,6 +73,7 @@ const saveSession = (session: Session) =>
const clearSession = () => localStorage.removeItem("matrix-auth-store");
const isDisconnected = (syncState, syncData) =>
syncState === "ERROR" && syncData?.error?.name === "ConnectionError";
interface ClientState {
loading: boolean;
isAuthenticated: boolean;
@@ -123,8 +124,6 @@ export const ClientProvider: FC<Props> = ({ children }) => {
const onSync = (state: SyncState, _old: SyncState, data: ISyncStateData) => {
setState((currentState) => {
logger.log("syntData.name", data?.error?.name, "state:", state);
console.log("Current state:", currentState);
return {
...currentState,
disconnected: isDisconnected(state, data),