Conversation
…OI or function and location
* I added the banana and then reworded. * Adding Initial Structure * Add long form description example * Add function description * Update example function description * Adding POI description * Adding POI description * Add server structure * Update Server description example * A start * made index.tsx a long form documentaion + more * I think I have all of the Client side. * Added API end points for Server Co-authored-by: Dustin Scherer <dustinscherer@dustins-mbp.lan> Co-authored-by: Dustin Scherer <dustin.scherer@cpanel.net> Co-authored-by: Dustin Scherer <dustin@angrylaser.com>
Bug fixes
… handle save new trails POI
… recording functionality
Everything is aligned and centered now.
… button not displaying
dustin-s
left a comment
There was a problem hiding this comment.
Have a look at my comments. There was one instance where we the auth verification looked like it would allow threw more than it should.
banan.txt
Outdated
| @@ -0,0 +1 @@ | |||
| blarg | |||
There was a problem hiding this comment.
Pretty sure this file isn't necessary.
| } | ||
|
|
||
| export default function AdminButtons({ | ||
| setModalVisible, // <-- Can we pull the modal in to this screen? |
There was a problem hiding this comment.
Comments like this likely are served better as project tasks to be done. "TODO"s in comment often get forgotten.
| trailDispatch({ type: TrailActions.AddLocation, payload: curLoc.coords }); | ||
| } | ||
|
|
||
| console.log("TaskManager.defineTask:"); |
There was a problem hiding this comment.
If the console logs are necessary to keep running in production, these are fine, but I imagine they could be taken out for non developmental running.
There was a problem hiding this comment.
I won't tag the other instances of console.logs, but the same thought applies.
| if (data) { | ||
| let fgStatus = await checkFGStatus(); // use as model for bgStatus | ||
|
|
||
| setAuth({ |
There was a problem hiding this comment.
This seems to set authenticated to true regardless of whether or not data. So if data returned 1, or "error" it would still.
There was a problem hiding this comment.
This is potentially a merge blocker.
|
Hey Dustin,
I don't understand the auth issue. The useFetch hook either returns data or an error. There is no need to check for data in dealWtihData(), because that is done in the useEffect(...,[data]) that is watching for the data to change (line #63: if (!data) return;. I suppose I could move that in to the function if it would make it more clear. I can't break this code right now. If you have a test case that breaks it, let me know and I will figure out how to fix it.
Chip
Chip Long Phone (Cell): 720-289-4751
On Monday, September 26, 2022 at 10:04:46 PM MDT, Dustin Scherer ***@***.***> wrote:
@dustin-s commented on this pull request.
Have a look at my comments. There was one instance where we the auth verification looked like it would allow threw more than it should.
In banan.txt:
@@ -0,0 +1 @@
+blarg
Pretty sure this file isn't necessary.
In client/app/components/AdminButtons/index.tsx:
+import { BASE_API } from "../../utils/constants";
+import { guardDataType } from "../../utils/typeGuard";
+import { TrailData } from "../../interfaces/TrailData";
+
+const LOCATION_TASK_NAME = "background-location-task";
+
+interface AdminButtonsProps {
+ gotTrailData: SubmitTrailData;
+ setGotTrailData(value: SetStateAction<SubmitTrailData>): void;
+ setModalVisible(value: SetStateAction<boolean>): void;
+ setIsLoading(value: SetStateAction<boolean>): void;
+ setError(value: SetStateAction<string>): void;
+}
+
+export default function AdminButtons({
+ setModalVisible, // <-- Can we pull the modal in to this screen?
Comments like this likely are served better as project tasks to be done. "TODO"s in comment often get forgotten.
In client/app/components/AdminButtons/index.tsx:
+ TaskManager.defineTask(LOCATION_TASK_NAME, async ({ data, error }) => {
+ if (error) {
+ console.error("TaskManager.defineTask error:");
+ console.error(error);
+ return;
+ }
+ const curData = data as any;
+
+ // const [location] = locations;
+ const location: LocationObject[] = curData.locations as LocationObject[];
+ const curLoc = location[location.length - 1];
+ if (!pauseRecording) {
+ trailDispatch({ type: TrailActions.AddLocation, payload: curLoc.coords });
+ }
+
+ console.log("TaskManager.defineTask:");
If the console logs are necessary to keep running in production, these are fine, but I imagine they could be taken out for non developmental running.
In client/app/screens/AdminLogin.tsx:
@@ -42,27 +40,35 @@ export default function AdminLogin({ navigation }: Props) {
};
const url = "users/login";
fetchData({ url, options });
+ }
+
+ const dealWithData = async () => {
+ if (data) {
+ let fgStatus = await checkFGStatus(); // use as model for bgStatus
+
+ setAuth({
This seems to set authenticated to true regardless of whether or not data. So if data returned 1, or "error" it would still.
In client/app/components/AdminButtons/index.tsx:
+ TaskManager.defineTask(LOCATION_TASK_NAME, async ({ data, error }) => {
+ if (error) {
+ console.error("TaskManager.defineTask error:");
+ console.error(error);
+ return;
+ }
+ const curData = data as any;
+
+ // const [location] = locations;
+ const location: LocationObject[] = curData.locations as LocationObject[];
+ const curLoc = location[location.length - 1];
+ if (!pauseRecording) {
+ trailDispatch({ type: TrailActions.AddLocation, payload: curLoc.coords });
+ }
+
+ console.log("TaskManager.defineTask:");
I won't tag the other instances of console.logs, but the same thought applies.
In client/app/screens/AdminLogin.tsx:
@@ -42,27 +40,35 @@ export default function AdminLogin({ navigation }: Props) {
};
const url = "users/login";
fetchData({ url, options });
+ }
+
+ const dealWithData = async () => {
+ if (data) {
+ let fgStatus = await checkFGStatus(); // use as model for bgStatus
+
+ setAuth({
This is potentially a merge blocker.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
First pull to the main branch from development for review.