mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2024-11-16 22:09:26 +08:00
Move conditional statements in homepage
This commit is contained in:
parent
a11ff2ee6f
commit
22820e139e
1 changed files with 17 additions and 16 deletions
|
@ -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" }}>
|
||||
|
|
Loading…
Reference in a new issue