Improve theme switching animation for a smoother user experience

Refactor `switchClearance` function in `os.tsx` to use a single `setTimeout` for mode switching, ensuring a smooth, non-repeating transition animation.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 279f1558-c0e3-40e4-8217-be7e9f4c6eca
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 144d7508-e90b-43b4-a0a4-a459de6f69ab
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/b984cb14-1d19-4944-922b-bc79e821ed35/279f1558-c0e3-40e4-8217-be7e9f4c6eca/nBprVcr
Replit-Helium-Checkpoint-Created: true
This commit is contained in:
sirpiglr 2025-12-17 03:44:54 +00:00
parent b2aa09e481
commit 752e14e480

View file

@ -205,9 +205,14 @@ export default function AeThexOS() {
const switchClearance = useCallback(() => {
const newMode: ClearanceMode = clearanceMode === 'foundation' ? 'corp' : 'foundation';
setIsSwitchingClearance(true);
setShowStartMenu(false);
setClearanceMode(newMode);
addToast(`Switched to ${CLEARANCE_THEMES[newMode].name}`, 'success');
setTimeout(() => {
setClearanceMode(newMode);
setIsSwitchingClearance(false);
addToast(`Switched to ${CLEARANCE_THEMES[newMode].name}`, 'success');
}, 600);
}, [clearanceMode, addToast]);
useEffect(() => {