Skip to content

Commit

Permalink
Make back button exist
Browse files Browse the repository at this point in the history
  • Loading branch information
mcoughlin committed Jan 23, 2024
1 parent 36c2857 commit 04b3033
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/(tabs)/index.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from "react";
import { StyleSheet, FlatList, Image, ActivityIndicator } from "react-native";
import { Link } from "expo-router";
import { Stack, Link } from "expo-router";

import dayjs from "dayjs";
import calendar from "dayjs/plugin/calendar";
Expand Down
2 changes: 1 addition & 1 deletion app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export {

export const unstable_settings = {
// Ensure that reloading on `/modal` keeps a back button present.
initialRouteName: "(tabs)",
initialRouteName: "/(tabs)",
};

// Prevent the splash screen from auto-hiding before asset loading is complete.
Expand Down
4 changes: 4 additions & 0 deletions components/PhotometryPlot.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ function PhotometryPlot({ dm, photometry, height, width }) {
return <Text>Loading photometry...</Text>;
}

if (data.length === 0) {
return <Text>No photometry available...</Text>;
}

const xDomain = photStats.days_ago.range;
const yDomain = photStats.mag.range;

Expand Down
8 changes: 2 additions & 6 deletions components/PostFollowupRequest.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ function PostFollowupRequest({ sourceId = null }) {
const [selectedAllocationId, setSelectedAllocationId] = useState(null);

const [filteredAllocationList, setFilteredAllocationList] = useState([]);
const [settingFilteredList, setSettingFilteredList] = useState(false);
const [requestType, setRequestType] = useState("triggered");

useEffect(() => {
Expand Down Expand Up @@ -84,7 +83,6 @@ function PostFollowupRequest({ sourceId = null }) {
// instrument form params with a non null formSchema
useEffect(() => {
async function filterAllocations() {
setSettingFilteredList(true);
if (requestType === "triggered") {
const filtered = (allocationList || []).filter(
(allocation) =>
Expand All @@ -107,18 +105,16 @@ function PostFollowupRequest({ sourceId = null }) {
);
setFilteredAllocationList(filtered);
}
setSettingFilteredList(false);
}
if (
allocationList !== null &&
allocationList.length > 0 &&
instrumentForms !== null &&
Object.keys(instrumentForms).length > 0 &&
settingFilteredList === false
Object.keys(instrumentForms).length > 0
) {
filterAllocations();
}
}, [allocationList, instrumentForms, settingFilteredList, requestType]);
}, [allocationList, instrumentForms, requestType]);

useEffect(() => {
if (
Expand Down
2 changes: 1 addition & 1 deletion components/utils/notifications.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async function registerForPushNotificationsAsync() {
alert("Must use physical device for Push Notifications");
}

return token.data;
return token?.data;
}

export { Notifications, registerForPushNotificationsAsync };

0 comments on commit 04b3033

Please sign in to comment.