mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-24 07:29:30 +01:00
mobile: fix e2e tests
This commit is contained in:
@@ -23,7 +23,7 @@ import {
|
||||
StackActions,
|
||||
useNavigation
|
||||
} from "@react-navigation/native";
|
||||
import React, { useRef, useState } from "react";
|
||||
import React, { useEffect, useRef, useState } from "react";
|
||||
import { ActivityIndicator, TextInput, View } from "react-native";
|
||||
import Icon from "react-native-vector-icons/MaterialCommunityIcons";
|
||||
import ToggleSwitch from "toggle-switch-react-native";
|
||||
@@ -103,6 +103,11 @@ const _SectionItem = ({ item }: { item: SettingSection }) => {
|
||||
}
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setIsHidden(item.hidden && item.hidden(item.property || current));
|
||||
setIsDisabled(item.disabled && item.disabled(item.property || current));
|
||||
}, [current, item]);
|
||||
|
||||
return isHidden ? null : (
|
||||
<Pressable
|
||||
disabled={item.type === "component" || isDisabled}
|
||||
|
||||
@@ -451,7 +451,7 @@ export const settingsGroups: SettingSection[] = [
|
||||
"local",
|
||||
"partial"
|
||||
);
|
||||
if (result.error) throw result.error as Error;
|
||||
if (result?.error) throw result.error as Error;
|
||||
} catch (e) {
|
||||
DatabaseLogger.error(e);
|
||||
const error = e;
|
||||
|
||||
Reference in New Issue
Block a user