use non-null assertions and optional chaining for authenticatedUser state handling

This commit is contained in:
2025-09-05 00:32:20 +02:00
parent 40dd479f40
commit cd80d15533
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -9,7 +9,7 @@ import {View} from "react-native";
export default function TextScreen() {
const {authenticatedUser} = useAuth();
const [textProps, setTextProps] = useState(authenticatedUser?.lastState.text);
const [textProps, setTextProps] = useState(authenticatedUser!.lastState?.text);
return (
<ThemedBackground>
@@ -29,7 +29,7 @@ export default function TextScreen() {
<CustomColorPicker
onSelect={rgb => setTextProps(prev => ({ ...prev!, color: rgb }))}
defaultColor={textProps!.color}
defaultColor={textProps?.color}
/>
</View>