Skip to content

Commit

Permalink
fix: crash when the search term contains %
Browse files Browse the repository at this point in the history
  • Loading branch information
Crissium committed Nov 5, 2023
1 parent 6961149 commit 97e70aa
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ android {
applicationId "com.gmail.blandilyte.silverdict"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 3
versionName "1.0.5"
versionCode 4
versionName "1.0.6"
}
signingConfigs {
debug {
Expand Down
4 changes: 2 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.gmail.blandilyte.silverdict"
android:versionCode="3"
android:versionName="1.0.5">
android:versionCode="4"
android:versionName="1.0.6">

<uses-permission android:name="android.permission.INTERNET" />

Expand Down
3 changes: 2 additions & 1 deletion android/app/src/main/play/release-notes/en-US/default.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Fix:
Tweak the colour of selects to match that of the text.
Tweak the colour of selects to match that of the text.
Crash when the search term contains %.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SilverDict",
"version": "1.0.5",
"version": "1.0.6",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand Down
12 changes: 9 additions & 3 deletions src/components/QueryScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,15 @@ export default function QueryScreen({ navigation }) {
return;
}

newQuery = decodeURIComponent(newQuery);
setQuery(newQuery);
newQuery = encodeURIComponent(newQuery);
try {
newQuery = decodeURIComponent(newQuery);
setQuery(newQuery);
newQuery = encodeURIComponent(newQuery);
}
catch (error) {
setQuery(newQuery);
newQuery = encodeURIComponent(newQuery);
}

fetch(`${apiPrefix}/query/${nameActiveGroup}/${newQuery}?dicts=True`)
.then(loadDataFromJsonResponse)
Expand Down

0 comments on commit 97e70aa

Please sign in to comment.