From c86bec7db2cd2062d06a1f63fff38eb1447c61d2 Mon Sep 17 00:00:00 2001 From: sam marshall Date: Tue, 1 Oct 2019 14:16:44 +0100 Subject: [PATCH] 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. --- .../siteplugins/components/plugin-content/plugin-content.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/siteplugins/components/plugin-content/plugin-content.ts b/src/core/siteplugins/components/plugin-content/plugin-content.ts index ede995524..b98fcc7d7 100644 --- a/src/core/siteplugins/components/plugin-content/plugin-content.ts +++ b/src/core/siteplugins/components/plugin-content/plugin-content.ts @@ -107,6 +107,10 @@ export class CoreSitePluginsPluginContentComponent implements OnInit, DoCheck { this.onContentLoaded.emit(refresh); }).catch((error) => { + // Make it think it's loaded - otherwise it sticks on 'loading' and stops navigation working. + this.content = '
'; + this.onContentLoaded.emit(refresh); + this.domUtils.showErrorModalDefault(error, 'core.errorloadingcontent', true); }).finally(() => { this.dataLoaded = true;