mirror of
https://github.com/Syngnat/GoNavi.git
synced 2026-07-21 21:01:55 +08:00
33 lines
751 B
TypeScript
33 lines
751 B
TypeScript
import { t as translateCatalog } from '../i18n';
|
|
|
|
export interface ConnectionWorkbenchState {
|
|
ready: boolean;
|
|
message: string;
|
|
}
|
|
|
|
type StartupReadinessTranslator = (key: string) => string;
|
|
|
|
export function getConnectionWorkbenchState(
|
|
isStoreHydrated: boolean,
|
|
hasAppliedInitialGlobalProxy: boolean,
|
|
translate: StartupReadinessTranslator = translateCatalog,
|
|
): ConnectionWorkbenchState {
|
|
if (!isStoreHydrated) {
|
|
return {
|
|
ready: false,
|
|
message: translate('app.startup_readiness.loading_local_config'),
|
|
};
|
|
}
|
|
if (!hasAppliedInitialGlobalProxy) {
|
|
return {
|
|
ready: false,
|
|
message: translate('app.startup_readiness.loading_security_config'),
|
|
};
|
|
}
|
|
return {
|
|
ready: true,
|
|
message: '',
|
|
};
|
|
}
|
|
|