Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix(city): initialize uIsMoon and currentHour from preset in CitySky

Ilya Eivy4d8f3e7e2724
diff --git a/client/src/components/city/CitySky.jsx b/client/src/components/city/CitySky.jsx
index f47a73ba48..ad759359a7 100644
--- a/client/src/components/city/CitySky.jsx
+++ b/client/src/components/city/CitySky.jsx
@@ -192,7 +192,8 @@ export default function CitySky({ settings }) {
const bodyGroupRef = useRef();
const lightRef = useRef();
const currentScaleRef = useRef(1.0);
- const currentHourRef = useRef(18); // start at sunset
+ const initialPreset = getTimeOfDayPreset(settings?.timeOfDay ?? 'sunset', settings?.skyTheme ?? 'cyberpunk');
+ const currentHourRef = useRef(initialPreset.hour ?? 18);
const skyMaterial = useMemo(() => {
const initialTheme = settings?.skyTheme ?? 'cyberpunk';
@@ -210,7 +211,7 @@ export default function CitySky({ settings }) {
uHorizonLow: { value: preset.horizonLow.clone() },
uSunDirection: { value: new THREE.Vector3(...initPos).normalize() },
uSunIntensity: { value: preset.sunIntensity },
- uIsMoon: { value: 0.0 },
+ uIsMoon: { value: preset.isMoon ? 1.0 : 0.0 },
uTime: { value: 0 },
},
side: THREE.BackSide,