When behavior depends on environment/config (feature availability, app base URLs, privacy/account links), ensure it’s derived in one place and applied consistently.
Apply these rules:
clineAppBaseUrl) separate.Example pattern (centralized builder):
function buildAccountUrl(appBaseUrl: string | undefined, path: string) {
const base = appBaseUrl ?? 'https://app.cline.bot'; // or a deterministic fallback
return `${base}${path}`;
}
// In AccountView:
const dashboardUrl = buildAccountUrl(clineAppBaseUrl, '/dashboard');
const privacyUrl = buildAccountUrl(clineAppBaseUrl, `/privacy?user=${user.id}`);
This prevents mixed environments, avoids undefined links/hidden actions, and keeps configuration and identity responsibilities properly separated.