-
Notifications
You must be signed in to change notification settings - Fork 0
Refactor to utilize context for metrics and sample manifest #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
897a889 to
27d58e5
Compare
owtaylor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally looks good, a few things could be improved (talking to agent rather than myself)
| const newStore = await fetchMetrics(); | ||
| setStore(newStore); | ||
| } catch (error) { | ||
| console.log("Error loading metrics", error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add an error?: string field to MetricsStore and Manifest so that the web page can display an error rather than just being stuck in a loading state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And please make the pages display the errors rather than content if the error fields are set
| import { createContext, useContext, useEffect, useState } from "react"; | ||
| import { BASE } from "../site"; | ||
|
|
||
| interface Manifest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this to SampleManifest
| postprocessors: string[]; | ||
| } | ||
|
|
||
| const emptyManifest: Manifest = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no point to this since useSampleManifest() returns Manifest | undefined - we can just use undefined.
This pull request includes the following changes:
This addresses the issue described in issue #1.