fix(user): guard openpaasId access during initial render\n\n- Use optional chaining across components reading userData.openpaasId\n- Prevent F5 crash when user data not yet hydrated\n- Cleanup unused imports
This commit is contained in:
@@ -30,7 +30,7 @@ function CalendarPopover({
|
||||
}) {
|
||||
const dispatch = useAppDispatch();
|
||||
const userId =
|
||||
useAppSelector((state) => state.user.userData.openpaasId) ?? "";
|
||||
useAppSelector((state) => state.user.userData?.openpaasId) ?? "";
|
||||
const [name, setName] = useState(calendar?.name ?? "");
|
||||
const [description, setDescription] = useState(calendar?.description ?? "");
|
||||
const [color, setColor] = useState(calendar?.color ?? "");
|
||||
|
||||
Reference in New Issue
Block a user