Skip to content
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

Ensure "last airport" exists before attempting to load it #709

Closed
erikquinn opened this issue Sep 19, 2017 · 4 comments
Closed

Ensure "last airport" exists before attempting to load it #709

erikquinn opened this issue Sep 19, 2017 · 4 comments
Labels
feature Addition of a COMPLETELY NEW feature

Comments

@erikquinn
Copy link
Member

During initialization of the app, check local storage for localstorage[STORAGE_KEY.ATC_LAST_AIRPORT] (the one we will subsequently attempt to load). If it is not present in the load list, that means there will be no airport file to load, and the app will never make it through the initialization process. If this is the case, reset the local storage (either the last airport value to the default airport), or all of the values... whatever it takes to be sure that users that had an airport cached that no longer exists will not have the site stuck in a state where it can never complete the load without manually flushing the cache.

@erikquinn erikquinn added the feature Addition of a COMPLETELY NEW feature label Sep 19, 2017
@n8rzz
Copy link
Member

n8rzz commented Sep 19, 2017

I thought we had a default value in there for cases when localStorage check comes back undefined? It seems not, or at least seems to not be implemented correctly ☹️

@erikquinn
Copy link
Member Author

erikquinn commented Sep 19, 2017

we may? which would mean this would be very easy since the framework would then be in place. What we need to resolve this particular problem would be to deal with when previously available airports are removed for whatever reason. For example, EHAM is broken. Someone who last played the game a long time ago while it was available, if the site is still cached, the value is EHAM, and that forces the app to load the airport EHAM, which doesn't exist, so KA-BOOM 💣

@n8rzz
Copy link
Member

n8rzz commented Sep 19, 2017

I see where you're going there. So we should also check that the stored airport is also available.

@sam-irl sam-irl mentioned this issue Sep 20, 2017
@n8rzz n8rzz reopened this Sep 28, 2017
@n8rzz
Copy link
Member

n8rzz commented Sep 28, 2017

The original solution implemented by this issue in #713 is incorrect and has caused #741. I have created #744 to address this.

@n8rzz n8rzz closed this as completed Sep 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Addition of a COMPLETELY NEW feature
Projects
None yet
Development

No branches or pull requests

2 participants