Skip to content

Commit

Permalink
Further MMKV bugfixes & bump to 0.7.9
Browse files Browse the repository at this point in the history
  • Loading branch information
micahlt committed Dec 28, 2024
1 parent af680f0 commit 5c88eba
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 44 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,7 @@ yarn-error.log
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
!.yarn/versions

# Expo
.expo/
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ android {
applicationId "com.micahlindley.offsides"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 42
versionName "0.7.8"
versionCode 43
versionName "0.7.9"
}
signingConfigs {
debug {
Expand Down
Binary file modified android/app/release/app-release.apk
Binary file not shown.
Binary file modified android/app/release/baselineProfiles/0/app-release.dm
Binary file not shown.
Binary file modified android/app/release/baselineProfiles/1/app-release.dm
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": 42,
"versionName": "0.7.8",
"versionCode": 43,
"versionName": "0.7.9",
"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.8",
"changelog": "This update fixes the issues with switching to joined groups or trying to find new groups. The long-press gesture for activity items has been changed to a horizontal swipe. As a new feature, you can swipe horizontally on the group name when browsing posts to quickly switch between your joined groups. There are other minor performance improvements and bug fixes included."
"latestVersion": "0.7.9",
"changelog": "This update solves an issue where posts could not be created. It includes other minor performance improvements and bug fixes as well."
}
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.8",
"version": "0.7.9",
"private": true,
"scripts": {
"android": "react-native run-android",
Expand Down
1 change: 0 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export default function App() {
crashlytics().log('Redirecting to LoginScreen');
setNeedsLogin(true);
}
console.log("POST SORT:", postSortMethod)
if (!postSortMethod) {
setPostSortMethod('postSortMethod');
}
Expand Down
1 change: 0 additions & 1 deletion src/components/GroupPicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function GroupPicker({ sheetRef }) {
}
};
const selectGroup = group => {
console.log('Group selected');
crashlytics().log('Group selected');
sheetRef?.current?.close();
setCurrentGroup(group);
Expand Down
10 changes: 5 additions & 5 deletions src/components/Post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ function Post({
});
};

if (post.attachments.length > 0) {
post.attachments.forEach(a => {
if (a.type == 'youtube') console.log(post.attachments);
});
}
// if (post.attachments.length > 0) {
// post.attachments.forEach(a => {
// if (a.type == 'youtube') console.log(post.attachments);
// });
// }

const deletePost = () => {
Alert.alert(
Expand Down
29 changes: 3 additions & 26 deletions src/screens/HomeScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ function HomeScreen({ navigation, route }) {
/** @type {SidechatPostOrComment[]} */([]),
);

console.log(postSortMethod)

React.useEffect(() => {
crashlytics().log('Loading HomeScreen');
needsUpdate().then(setUpdateBadge);
Expand All @@ -88,32 +86,13 @@ function HomeScreen({ navigation, route }) {
if (!loadingPosts) {
InteractionManager.runAfterInteractions(() => {
if (appState.userToken && currentGroup.id) {
fetchPosts(true);
fetchPosts(true, currentGroup.id);
} else {
console.log('App state is undefined, will load in a second');
}
});
}
}, [postSortMethod]);

React.useEffect(() => {
crashlytics().log('Detected group change');
if (!loadingPosts) {
InteractionManager.runAfterInteractions(() => {
if (appState.userToken && currentGroup.id) {
if (params?.groupID) {
fetchPosts(true, currentGroup.id);
} else {
crashlytics().log(
"No group selected - this shouldn't ever happen!",
);
}
} else {
console.log('App state is undefined, will load in a second');
}
});
}
}, [currentGroup]);
}, [postSortMethod, currentGroup]);

const uniquePosts = useUniqueList(posts);
const renderItem = React.useCallback(each => {
Expand Down Expand Up @@ -146,7 +125,6 @@ function HomeScreen({ navigation, route }) {
setPosts([]);
API.getGroupPosts(override || currentGroup.id, postSortMethod).then(
res => {
console.log('GET GROUP POSTS');
if (res.posts) {
setPosts(res.posts.filter(i => i.id));
setCursor(res.cursor);
Expand All @@ -161,7 +139,6 @@ function HomeScreen({ navigation, route }) {
postSortMethod,
cursor,
).then(res => {
console.log('GET POSTS');
if (res.posts) {
setPosts(posts.concat(res.posts.filter(i => i.id)));
setCursor(res.cursor);
Expand Down Expand Up @@ -392,7 +369,7 @@ function HomeScreen({ navigation, route }) {
groupID:
currentGroup.name == 'Home'
? appState.schoolGroupID
: currentGroup.name,
: currentGroup.id,
})
}
/>
Expand Down
1 change: 1 addition & 0 deletions src/screens/MyProfileScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import timesago from 'timesago';
import { useFocusEffect } from '@react-navigation/native';
import crashlytics from '@react-native-firebase/crashlytics';
import UserContent from '../components/UserContent';
import { useMMKVObject } from 'react-native-mmkv';

const BORDER_RADIUS = 15;

Expand Down
2 changes: 1 addition & 1 deletion src/screens/WriterScreen.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const BORDER_RADIUS = 10;
function WriterScreen({ navigation, route }) {
const { mode, groupID, postID, replyID, parentID } = route.params;
if (mode != 'comment' && mode != 'post') return false;
const { appState, setAppState } = React.useContext(AppContext);
const { appState } = React.useContext(AppContext);
const API = appState.API;
const { colors } = useTheme();
const [error, setError] = React.useState(false);
Expand Down

0 comments on commit 5c88eba

Please sign in to comment.