Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: hasItem method typo #19

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/src/main/cpp/cpp-adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ bool hasItem(const std::string key) {
JNIEnv *jniEnv = GetJniEnv();
java_class = jniEnv->GetObjectClass(java_object);
jmethodID hasItemMethodID =
jniEnv->GetMethodID(java_class, "hasitem", "(Ljava/lang/String;)Z");
jniEnv->GetMethodID(java_class, "hasItem", "(Ljava/lang/String;)Z");
jvalue params[1];
params[0].l = string2jstring(jniEnv, key);

Expand Down
8 changes: 8 additions & 0 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

export default function App() {
const [result, setResult] = useState<string | undefined>();
const [hasItem, setHasItem] = useState(false);
const [text, setText] = useState('');

const getTestValue = async () => {
Expand Down Expand Up @@ -44,8 +45,9 @@
<ScrollView contentContainerStyle={styles.container}>
<Rectangle />
<Text>{result}</Text>
<Text>{hasItem ? 'Item exists' : 'Item does not exist'}</Text>
<TextInput
style={{ height: 50, width: '100%' }}

Check warning on line 50 in example/src/App.tsx

View workflow job for this annotation

GitHub Actions / lint

Inline style: { height: 50, width: '100%' }
defaultValue={text}
onChangeText={setText}
/>
Expand Down Expand Up @@ -78,6 +80,12 @@
getTestValue();
}}
/>
<Button
title="has item"
onPress={async () => {
setHasItem(await SecureStorage.hasItem('test'));
}}
/>
</ScrollView>
);
}
Expand Down
Loading