Move conditional statements in homepage

This commit is contained in:
Keannu Bernasol 2023-10-14 10:51:28 +08:00
parent a11ff2ee6f
commit 22820e139e

View file

@ -363,22 +363,7 @@ export default function Home() {
});
function CustomMap() {
if (
(StudentStatusQuery.isFetching && studying) ||
StudentStatusListQuery.isFetching ||
StudyGroupQuery.isFetching ||
(StudentStatusQuery.isFetching && !studying) ||
StudentStatusListGlobalQuery.isFetching ||
StudyGroupGlobalQuery.isFetching
) {
return (
<>
<View style={{ paddingVertical: 8 }} />
<ActivityIndicator size={96} color={colors.secondary_1} />
<Text style={styles.text_white_medium}>Loading...</Text>
</>
);
} else if (!locationPermitted) {
if (!locationPermitted) {
console.log(locationPermitted);
return (
<>
@ -390,6 +375,22 @@ export default function Home() {
);
} else if (dist && location && locationFetched) {
if (dist <= 1 || map_distance_override) {
if (
(StudentStatusQuery.isFetching && studying) ||
StudentStatusListQuery.isFetching ||
StudyGroupQuery.isFetching ||
(StudentStatusQuery.isFetching && !studying) ||
StudentStatusListGlobalQuery.isFetching ||
StudyGroupGlobalQuery.isFetching
) {
return (
<>
<View style={{ paddingVertical: 8 }} />
<ActivityIndicator size={96} color={colors.secondary_1} />
<Text style={styles.text_white_medium}>Loading...</Text>
</>
);
}
return (
<>
<View style={{ alignSelf: "flex-end" }}>