mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-19 00:40:59 +00:00
fix(wizard): remove redundant Space CTA (#2416)
Co-authored-by: Chan <dadachann@users.noreply.github.com>
This commit is contained in:
@@ -16,7 +16,6 @@ import {
|
||||
|
||||
import { httpClient } from '@/app/infra/http/HttpClient';
|
||||
import {
|
||||
userInfo,
|
||||
systemInfo,
|
||||
bootstrapWorkspaceSession,
|
||||
initializeSystemInfo,
|
||||
@@ -490,24 +489,6 @@ export default function WizardPage() {
|
||||
t,
|
||||
]);
|
||||
|
||||
// ---- Space auth redirect ----
|
||||
|
||||
const handleSpaceAuth = useCallback(async () => {
|
||||
try {
|
||||
const callbackUrl = `${window.location.origin}/auth/space/callback`;
|
||||
const resp = await httpClient.getSpaceAuthorizeUrl(callbackUrl);
|
||||
window.location.href = resp.authorize_url;
|
||||
} catch (err) {
|
||||
console.error('Failed to get space authorize URL', err);
|
||||
toast.error(t('wizard.spaceAuthError'));
|
||||
}
|
||||
}, [t]);
|
||||
|
||||
// ---- Check if local account ----
|
||||
// Re-evaluated after remote data fetch (when userInfo is populated)
|
||||
const isLocalAccount =
|
||||
!isLoading && (!userInfo || userInfo.account_type === 'local');
|
||||
|
||||
// ---- Skip handler ----
|
||||
const [showSkipConfirm, setShowSkipConfirm] = useState(false);
|
||||
const [isSkipping, setIsSkipping] = useState(false);
|
||||
@@ -662,8 +643,6 @@ export default function WizardPage() {
|
||||
runnerOptions={runnerOptions}
|
||||
selected={selectedRunner}
|
||||
onSelect={handleSelectRunner}
|
||||
isLocalAccount={isLocalAccount}
|
||||
onSpaceAuth={handleSpaceAuth}
|
||||
runnerConfigItems={selectedRunnerConfigItems}
|
||||
runnerConfigValues={runnerConfig}
|
||||
onRunnerConfigChange={setRunnerConfig}
|
||||
@@ -1006,8 +985,6 @@ function StepAIEngine({
|
||||
runnerOptions,
|
||||
selected,
|
||||
onSelect,
|
||||
isLocalAccount,
|
||||
onSpaceAuth,
|
||||
runnerConfigItems,
|
||||
runnerConfigValues,
|
||||
onRunnerConfigChange,
|
||||
@@ -1015,8 +992,6 @@ function StepAIEngine({
|
||||
runnerOptions: { name: string; label: { en_US: string; zh_Hans: string } }[];
|
||||
selected: string | null;
|
||||
onSelect: (name: string) => void;
|
||||
isLocalAccount: boolean;
|
||||
onSpaceAuth: () => void;
|
||||
runnerConfigItems: IDynamicFormItemSchema[];
|
||||
runnerConfigValues: Record<string, unknown>;
|
||||
onRunnerConfigChange: (v: Record<string, unknown>) => void;
|
||||
@@ -1127,28 +1102,6 @@ function StepAIEngine({
|
||||
</Card>
|
||||
);
|
||||
})}
|
||||
|
||||
{/* Space promotion banner */}
|
||||
{selected === 'local-agent' && isLocalAccount && (
|
||||
<div className="animate-in fade-in slide-in-from-left-2 duration-300">
|
||||
<div className="relative rounded-lg p-[2px] bg-gradient-to-r from-purple-500 via-pink-500 to-orange-500">
|
||||
<div className="rounded-[calc(0.5rem-2px)] bg-background p-3 flex flex-col items-center gap-2 text-center">
|
||||
<Sparkles className="w-6 h-6 text-purple-500 shrink-0" />
|
||||
<p className="text-xs font-medium">
|
||||
{t('wizard.spaceBanner.message')}
|
||||
</p>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={onSpaceAuth}
|
||||
className="w-full"
|
||||
>
|
||||
{t('wizard.spaceBanner.action')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user