Proper gate return preventing running further codes

This commit is contained in:
Zhiyuan Zheng 2022-02-12 11:12:05 +01:00
parent 9936f6c921
commit 50141b2963
2 changed files with 2 additions and 1 deletions

View File

@ -4,7 +4,7 @@
"native": "220206", "native": "220206",
"major": 3, "major": 3,
"minor": 4, "minor": 4,
"patch": 3, "patch": 4,
"expo": "44.0.0" "expo": "44.0.0"
}, },
"description": "tooot app for Mastodon", "description": "tooot app for Mastodon",

View File

@ -38,6 +38,7 @@ const TabSharedToot: React.FC<TabSharedStackScreenProps<'Tab-Shared-Toot'>> = ({
// Auto go back when toot page is empty // Auto go back when toot page is empty
if (flattenData.length === 0) { if (flattenData.length === 0) {
navigation.goBack() navigation.goBack()
return
} }
setItemsLength(flattenData.length) setItemsLength(flattenData.length)
if (!scrolled.current) { if (!scrolled.current) {