Skip to content

Commit

Permalink
Fix polls not properly escaping text
Browse files Browse the repository at this point in the history
  • Loading branch information
micahlt committed Aug 26, 2024
1 parent f69a860 commit 6f551ec
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 15 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ android {
applicationId "com.micahlindley.offsides"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 35
versionName "0.7.1"
versionCode 36
versionName "0.7.2"
}
signingConfigs {
debug {
Expand Down
Binary file not shown.
4 changes: 2 additions & 2 deletions android/app/release/output-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 35,
"versionName": "0.7.1",
"versionCode": 36,
"versionName": "0.7.2",
"outputFile": "app-release.apk"
}
],
Expand Down
4 changes: 2 additions & 2 deletions docs/latest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"latestVersion": "0.7.1",
"changelog": "This update includes minor bugfixes as well as support for viewing and voting on polls."
"latestVersion": "0.7.2",
"changelog": "This update includes a bugfix for the issue that caused app crashes when polls were viewed."
}
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "offsides",
"version": "0.7.1",
"version": "0.7.2",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand Down
20 changes: 14 additions & 6 deletions src/components/Poll.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ function Poll({ poll }) {
API.voteOnPoll(poll.id, choiceIndex);
};

console.log(poll);

if (!poll) return null;
return (
<View>
Expand All @@ -44,13 +46,19 @@ function Poll({ poll }) {
padding: 10,
borderRadius: 10,
}}>
<Text
style={{ color: colors.onSecondaryContainer }}
variant="labelLarge">
{option.text}
</Text>
{option.count && (
{!!option?.text ? (
<Text
style={{ color: colors.onSecondaryContainer }}
variant="labelLarge">
{option.text}
</Text>
) : (
<></>
)}
{!!option?.count ? (
<Text variant="bodySmall">{option.count} votes</Text>
) : (
<></>
)}
</View>
</TouchableRipple>
Expand Down
2 changes: 2 additions & 0 deletions src/screens/HomeScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ function HomeScreen({ navigation, route }) {
setPosts([]);
API.getGroupPosts(override || params.groupID, postCategory).then(
res => {
console.log('GET GROUP POSTS');
if (res.posts) {
setPosts(res.posts.filter(i => i.id));
setCursor(res.cursor);
Expand All @@ -141,6 +142,7 @@ function HomeScreen({ navigation, route }) {
postCategory,
cursor,
).then(res => {
console.log('GET POSTS');
if (res.posts) {
setPosts(posts.concat(res.posts.filter(i => i.id)));
setCursor(res.cursor);
Expand Down

0 comments on commit 6f551ec

Please sign in to comment.