MOBILE-3180 Site plugins: Plugin pages offline can break navigation

For pages served via a site plugin, if the page has never been viewed
(there is no cached version) then if you try to view the page when
offline, the navigation broke because page loading never finished.

This change makes it finish page loading (with a blank page) if it
shows the error about failing to load it.
main
sam marshall 2019-10-01 14:16:44 +01:00
parent bcb41032f5
commit c86bec7db2
1 changed files with 4 additions and 0 deletions

View File

@ -107,6 +107,10 @@ export class CoreSitePluginsPluginContentComponent implements OnInit, DoCheck {
this.onContentLoaded.emit(refresh); this.onContentLoaded.emit(refresh);
}).catch((error) => { }).catch((error) => {
// Make it think it's loaded - otherwise it sticks on 'loading' and stops navigation working.
this.content = '<div></div>';
this.onContentLoaded.emit(refresh);
this.domUtils.showErrorModalDefault(error, 'core.errorloadingcontent', true); this.domUtils.showErrorModalDefault(error, 'core.errorloadingcontent', true);
}).finally(() => { }).finally(() => {
this.dataLoaded = true; this.dataLoaded = true;