π€― LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
import { DesktopOnboardingScreen } from './types';
interface ResolveInitialScreenInput {
/** Has the user previously completed onboarding on this install? */
everCompleted: boolean;
/** Running on macOS β drives the Permissions screen fallback. */
isMac: boolean;
/** Explicit `?screen=` query parameter, when present and valid. */
requested: DesktopOnboardingScreen | null;
/** Whatever screen the component last persisted, or `null` if cleared/missing. */
saved: DesktopOnboardingScreen | null;
}
/**
* Pick which onboarding screen the user should land on when entering
* `/desktop-onboarding`. Priority:
*
* 1. `requested` from the URL β explicit deep-link wins.
* 2. `saved` β a mid-flow user resumes where they left off.
* 3. `Login` if the user has previously completed onboarding.
* 4. `Welcome` for first-time users.
*
* On non-macOS, `Permissions` is rewritten to `KeepAwake` since the macOS-only
* screen has no useful content.
*/
export const resolveInitialScreen = ({
everCompleted,
isMac,
requested,
saved,
}: ResolveInitialScreenInput): DesktopOnboardingScreen => {
const fallback = everCompleted ? DesktopOnboardingScreen.Login : DesktopOnboardingScreen.Welcome;
const chosen = requested ?? saved ?? fallback;
if (!isMac && chosen === DesktopOnboardingScreen.Permissions) {
return DesktopOnboardingScreen.KeepAwake;
}
return chosen;
};