Ensures media-less posts don't get into timelines or grids. Fixes #31

This commit is contained in:
Nat 2022-03-29 20:38:04 -07:00
parent 4f233be6e1
commit e67064d0c3
3 changed files with 11851 additions and 19 deletions

11858
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -34,6 +34,12 @@ const GridPostJsx = (props) => {
} }
const GridViewJsx = (props) => { const GridViewJsx = (props) => {
// Ensure only posts with media get into the grid
const postsWithMedia = props.posts.filter(
p => p.media_attachments != null
&& p.media_attachments.length > 0
);
let rows = partition(props.posts, 3); let rows = partition(props.posts, 3);
return ( return (
<View> <View>

View File

@ -4,6 +4,12 @@ import { View } from "react-native";
import { PostByDataJsx } from "src/components/posts/post"; import { PostByDataJsx } from "src/components/posts/post";
const TimelineViewJsx = (props) => { const TimelineViewJsx = (props) => {
// Ensure only posts with media get in the timeline
const posts = props.posts.filter(
p => p.media_attachments != null
&& p.media_attachments.length > 0
);
return ( return (
<View> <View>
{ props.posts.map((post, i) => { { props.posts.map((post, i) => {