From ff9161d8e70fc2e6d066fd045bd2a380c63cb46c Mon Sep 17 00:00:00 2001
From: Paul Frazee <pfrazee@gmail.com>
Date: Sat, 5 Nov 2022 16:12:06 -0500
Subject: Sizing and spacing fixes based on on-device testing

---
 src/view/com/post-thread/PostThread.tsx | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

(limited to 'src/view/com/post-thread/PostThread.tsx')

diff --git a/src/view/com/post-thread/PostThread.tsx b/src/view/com/post-thread/PostThread.tsx
index 8a0ddab5d..5d0a5ba4b 100644
--- a/src/view/com/post-thread/PostThread.tsx
+++ b/src/view/com/post-thread/PostThread.tsx
@@ -1,4 +1,4 @@
-import React, {useState, useEffect, useRef} from 'react'
+import React, {useState, useEffect} from 'react'
 import {observer} from 'mobx-react-lite'
 import {ActivityIndicator, FlatList, Text, View} from 'react-native'
 import {
@@ -9,12 +9,9 @@ import {useStores} from '../../../state'
 import {SharePostModel} from '../../../state/models/shell'
 import {PostThreadItem} from './PostThreadItem'
 
-const UPDATE_DELAY = 2e3 // wait 2s before refetching the thread for updates
-
 export const PostThread = observer(function PostThread({uri}: {uri: string}) {
   const store = useStores()
   const [view, setView] = useState<PostThreadViewModel | undefined>()
-  const [lastUpdate, setLastUpdate] = useState<number>(Date.now())
 
   useEffect(() => {
     if (view?.params.uri === uri) {
@@ -27,14 +24,6 @@ export const PostThread = observer(function PostThread({uri}: {uri: string}) {
     newView.setup().catch(err => console.error('Failed to fetch thread', err))
   }, [uri, view?.params.uri, store])
 
-  // TODO
-  // useFocusEffect(() => {
-  //   if (Date.now() - lastUpdate > UPDATE_DELAY) {
-  //     view?.update()
-  //     setLastUpdate(Date.now())
-  //   }
-  // })
-
   const onPressShare = (uri: string) => {
     store.shell.openModal(new SharePostModel(uri))
   }
@@ -83,6 +72,7 @@ export const PostThread = observer(function PostThread({uri}: {uri: string}) {
       renderItem={renderItem}
       refreshing={view.isRefreshing}
       onRefresh={onRefresh}
+      style={{flex: 1}}
     />
   )
 })
-- 
cgit 1.4.1

