OpenWaterFoundation / owf-app-snodas-ng

Open Water Foundation SNODAS snowpack user interface built with Angular
0 stars 0 forks source link

Selecting a predefined date rate fails if app is not refreshed for the current date #29

Open smalers opened 2 years ago

smalers commented 2 years ago

There is a case where the animation will not work, as follows:

  1. Open the application and leave up with refreshing the next day.
  2. Try to use the animation with a preselected period. The user will not be shown a warning and pressing the play button does nothing. A console message is shown indicating that the day must be recognized, I think it must be in the choice?

If what is required is to refresh the page because it does not show the current day, then a warning can be shown to do that.

Nightsphere commented 2 years ago

Found the issue:

image

The page displays and contains the dates when it was initially loaded. I have now set up the app-config.json file to accept a refreshTime property, which takes an array of arrays. Each separate array contains 3 digits representing the hours, minutes, and seconds in military time that the pages needs to refresh. The following example is what the property contains as a value to refresh the page at 8:30am and 2:00pm:

{
  "refreshTime": [
    [8, 0, 0],
    [13, 30, 0]
  ]
}

This does not solve the issue of a someone using it between midnight and the first refresh however. Using SNODAS between those times will fetch the current day, but the data aren't updated until around 8:00am.

I could put in logic to check the time of the current day, and if it's earlier than 8:00am, use yesterday's date instead. I feel like that's confusing to a user though. Maybe some kind of info popup that let's them know the data won't be updated until 8? I'll discuss with Steve.