Before this change, popups would remain in the loading state with the spinning icon if the wiki fetch fails.
This change introduces ZDPopup.loadContentFromQuery which drives popup content management for queried data. A "query" is just a Promise that resolves to a string, and rejects if it ultimately fails. A query can make chained calls in cases of fallbacks and redirects, as long as a string is returned in the end.
Testing
Given https://github.com/zeldadungeon/maps/issues/88 , I can't do full end-to-end testing locally. But I was able to mock out query results for a few different cases. The error screenshots are real though!
Summary
Before this change, popups would remain in the loading state with the spinning icon if the wiki fetch fails.
This change introduces
ZDPopup.loadContentFromQuery
which drives popup content management for queried data. A "query" is just a Promise that resolves to a string, and rejects if it ultimately fails. A query can make chained calls in cases of fallbacks and redirects, as long as a string is returned in the end.Testing
Given https://github.com/zeldadungeon/maps/issues/88 , I can't do full end-to-end testing locally. But I was able to mock out query results for a few different cases. The error screenshots are real though!
Case: Summary
Case: Section
Case: Page Content
Case: Map Page