Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp
782 B
Raw Blame
// SPDX-License-Identifier: AGPL-3.0-or-later

import Initialization from '@app/features/app/state/Initialization';
import Accounts from '@app/features/auth/state/Accounts';
import DeveloperOptions from '@app/features/devtools/state/DeveloperOptions';
import GatewaySessions from '@app/features/gateway/transport/GatewaySessionPool';

export function isClientBooting(): boolean {
	if (DeveloperOptions.bypassLoadingSkeleton) {
		return false;
	}
	if (DeveloperOptions.forceLoadingSkeleton) {
		return true;
	}
	return !Initialization.hasCompletedInitialLoad;
}

export function isClientReconnecting(): boolean {
	if (isClientBooting() || Accounts.transitioning) {
		return false;
	}
	return GatewaySessions.foregroundConnection.isConnectionInterrupted || !Initialization.isReady;
}