Skip to content

Commit 1455f33

Browse files
authored
Merge pull request #1031 from trycompai/claudio/comp-225-clean-up-animated-flow-ai-loader-edited-convert-to-banner
[dev] [claudfuen] claudio/comp-225-clean-up-animated-flow-ai-loader-edited-convert-to-banner
2 parents f9823f2 + 32cd92e commit 1455f33

4 files changed

Lines changed: 6 additions & 26 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,5 @@ jobs:
4343
GITHUB_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
4444
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} # Uncomment if publishing to npm
4545
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
46+
HUSKY: 0 # Skip husky hooks in CI
4647
run: npx semantic-release

apps/app/src/app/(app)/setup/components/AnimatedGradientBackgroundWrapper.tsx

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,6 @@ export function AnimatedGradientBackgroundWrapper() {
77
const [scale, setScale] = useState(0.7);
88

99
useEffect(() => {
10-
// Function to calculate scale from localStorage
11-
const updateScale = () => {
12-
if (typeof window !== 'undefined') {
13-
const stepIndex = parseInt(localStorage.getItem('onboarding-step-index') || '0');
14-
const totalSteps = parseInt(localStorage.getItem('onboarding-total-steps') || '9');
15-
16-
// Calculate scale based on step progress (0.7 to 1.5)
17-
const progressScale = 0.7 + (stepIndex / (totalSteps - 1)) * 0.8;
18-
setScale(progressScale);
19-
}
20-
};
21-
22-
// Initial load
23-
updateScale();
24-
2510
// Listen for step changes
2611
const handleStepChange = (event: Event) => {
2712
const customEvent = event as CustomEvent;

apps/app/src/app/(app)/setup/components/OrganizationSetupForm.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,23 +62,18 @@ export function OrganizationSetupForm({
6262

6363
const hasExistingOrgs = existingOrganizations.length > 0;
6464

65-
// Save step progress to localStorage
65+
// Dispatch custom event for background animation when step changes
6666
useEffect(() => {
6767
if (typeof window !== 'undefined') {
6868
if (isFinalizing) {
6969
// Set to max scale when finalizing
70-
localStorage.setItem('onboarding-progress', '1');
7170
window.dispatchEvent(
7271
new CustomEvent('onboarding-step-change', {
7372
detail: { stepIndex: steps.length - 1, totalSteps: steps.length, progress: 1 },
7473
}),
7574
);
7675
} else {
7776
const progress = stepIndex / (steps.length - 1);
78-
localStorage.setItem('onboarding-step-index', stepIndex.toString());
79-
localStorage.setItem('onboarding-total-steps', steps.length.toString());
80-
localStorage.setItem('onboarding-progress', progress.toString());
81-
8277
// Dispatch custom event to notify the background wrapper
8378
window.dispatchEvent(
8479
new CustomEvent('onboarding-step-change', {

apps/app/src/app/(app)/setup/hooks/useOnboardingForm.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ import { z } from 'zod';
1111
import { createOrganization } from '../actions/create-organization';
1212
import { createOrganizationMinimal } from '../actions/create-organization-minimal';
1313
import type { OnboardingFormFields } from '../components/OnboardingStepInput';
14-
import { STORAGE_KEY, companyDetailsSchema, steps } from '../lib/constants';
14+
import { companyDetailsSchema, steps } from '../lib/constants';
1515
import { updateSetupSession } from '../lib/setup-session';
1616
import type { CompanyDetails } from '../lib/types';
17-
import { useLocalStorage } from './useLocalStorage';
1817

1918
interface UseOnboardingFormProps {
2019
setupId?: string;
@@ -29,9 +28,8 @@ export function useOnboardingForm({
2928
}: UseOnboardingFormProps = {}) {
3029
const router = useRouter();
3130

32-
// If we have a setupId, use the initialData from KV, otherwise use localStorage
33-
const [savedAnswers, setSavedAnswers] = useLocalStorage<Partial<CompanyDetails>>(
34-
STORAGE_KEY,
31+
// Use state instead of localStorage - initialized from KV data if setupId exists
32+
const [savedAnswers, setSavedAnswers] = useState<Partial<CompanyDetails>>(
3533
setupId && initialData ? initialData : {},
3634
);
3735

@@ -108,6 +106,7 @@ export function useOnboardingForm({
108106
// Organization created, now redirect to plans page
109107
router.push(`/upgrade/${data.organizationId}`);
110108

109+
// Clear answers after successful creation
111110
setSavedAnswers({});
112111
} else {
113112
toast.error('Failed to create organization');

0 commit comments

Comments
 (0)