mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix crash in search
This commit is contained in:
@@ -70,14 +70,14 @@ export const HeaderTitle = () => {
|
|||||||
style={{
|
style={{
|
||||||
opacity: DDS.isLargeTablet() ? 1 : opacity,
|
opacity: DDS.isLargeTablet() ? 1 : opacity,
|
||||||
}}>
|
}}>
|
||||||
<Heading color={headerTextState.color}>
|
<Heading color={headerTextState?.color}>
|
||||||
<Heading color={colors.accent}>
|
<Heading color={colors.accent}>
|
||||||
{headerTextState.heading.slice(0, 1) === '#' ? '#' : null}
|
{headerTextState?.heading.slice(0, 1) === '#' ? '#' : null}
|
||||||
</Heading>
|
</Heading>
|
||||||
|
|
||||||
{headerTextState.heading.slice(0, 1) === '#'
|
{headerTextState?.heading.slice(0, 1) === '#'
|
||||||
? headerTextState.heading.slice(1)
|
? headerTextState?.heading.slice(1)
|
||||||
: headerTextState.heading}
|
: headerTextState?.heading}
|
||||||
</Heading>
|
</Heading>
|
||||||
</Animated.View>
|
</Animated.View>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -307,6 +307,7 @@ const ListEmptyComponent = ({loading = true, placeholderData}) => {
|
|||||||
const {height} = useWindowDimensions();
|
const {height} = useWindowDimensions();
|
||||||
|
|
||||||
const onHeaderStateChange = (event) => {
|
const onHeaderStateChange = (event) => {
|
||||||
|
if (!event) return;
|
||||||
setHeaderTextState(event);
|
setHeaderTextState(event);
|
||||||
};
|
};
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@@ -350,16 +351,16 @@ const ListEmptyComponent = ({loading = true, placeholderData}) => {
|
|||||||
fontSize={SIZE.md}
|
fontSize={SIZE.md}
|
||||||
accentColor="bg"
|
accentColor="bg"
|
||||||
accentText={
|
accentText={
|
||||||
COLORS_NOTE[headerTextState.heading.toLowerCase()]
|
COLORS_NOTE[headerTextState?.heading?.toLowerCase()]
|
||||||
? headerTextState.heading.toLowerCase()
|
? headerTextState.heading?.toLowerCase()
|
||||||
: 'accent'
|
: 'accent'
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
) : loading ? (
|
) : loading ? (
|
||||||
<ActivityIndicator
|
<ActivityIndicator
|
||||||
color={
|
color={
|
||||||
COLORS_NOTE[headerTextState.heading.toLowerCase()]
|
COLORS_NOTE[headerTextState?.heading?.toLowerCase()]
|
||||||
? COLORS_NOTE[headerTextState.heading.toLowerCase()]
|
? COLORS_NOTE[headerTextState?.heading?.toLowerCase()]
|
||||||
: colors.accent
|
: colors.accent
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user