-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feat/real api compatible #17
Conversation
@@ -322,6 +323,11 @@ export const getBlockedAreas = async function* ({ | |||
payload, | |||
abortSignal, | |||
})) { | |||
if (chunk.result.objects[0].objectId !== '0') { |
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.
Isnt it better to do optional chaining? using ?. or else if data wasn't present it could lead to errors
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.
Better to check in all the files
@@ -322,6 +323,11 @@ export const getBlockedAreas = async function* ({ | |||
payload, | |||
abortSignal, | |||
})) { | |||
if (chunk.result.objects[0].objectId !== '0') { | |||
objectId = chunk.result.objects[0].objectId; |
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.
Isnt it better to do optional chaining? using ?. or else if data wasn't present it could lead to errors
objectId = chunk.result.objects[0].objectId; | ||
continue; | ||
} | ||
chunk.result.objects[0].objectId = objectId; |
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.
Isnt it better to do optional chaining? using ?. or else if data wasn't present it could lead to errors
@@ -358,6 +371,11 @@ export const getSignalAreas = async function* ({ | |||
payload, | |||
abortSignal, | |||
})) { | |||
if (chunk.result.objects[0].objectId !== '0') { |
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.
Isnt it better to do optional chaining? using ?. or else if data wasn't present it could lead to errors
spatialId?: string; | ||
startTime?: string; | ||
endTime?: string; | ||
'windDirection (degree)': number; |
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.
I hope its not recommend to name vairables in this manner. better to rename it to windDirectionDegree
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.
fix in the below other variables as well
startTime?: string; | ||
endTime?: string; | ||
'windDirection (degree)': number; | ||
'windSpeed (knot)': number; |
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.
windDirectionKnot
...definition.currentWeather, | ||
startTime: definition.currentWeather.startTime, | ||
endTime: definition.currentWeather.endTime, | ||
'windDirection (degree)': definition.currentWeather.windDirection, |
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.
I hope its not recommend to name vairables in this manner. better to rename it to windDirectionDegree
@@ -20,7 +20,7 @@ interface Props { | |||
reference: React.RefObject<CesiumComponentRef<Viewer>>; | |||
} | |||
const CurrentWeatherViewer = (props: Props) => { | |||
const [type, setType] = useState<string>('windDirection'); | |||
const [type, setType] = useState<string>('windDirection (degree)'); |
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.
same
@Thiniraxz Merging it due to urgency, please fix and raise another PR |
No description provided.