diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 113e1096714aa7fd43d779a983c97380f13de169..5a056d444c86918021de786536f86ab93515a333 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,23 @@ All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog`_, and this project adheres to `Semantic Versioning`_. +Unreleased +---------- + +Changed +~~~~~~~ + +* Change default network policy of the Apollo client to `cache-and-network`. + +Fixed +~~~~~ + +* In case the status code of a response was not in the range between 200 and 299 + but still indicates that the response should be delivered, e. g. in the case + of a redirected request, the service worker served the offline fallback page. +* In some cases, the resize listener for the IFrame in the `LegacyBaseTemplate` + did not trigger. + `3.0b1` - 2023-02-27 -------------------- diff --git a/aleksis/core/frontend/app/apollo.js b/aleksis/core/frontend/app/apollo.js index c14ba118d0c4d14558f23a747a98b207067ff7b2..1b23d43fb32d402c7e802a7e892e16f70545aa0e 100644 --- a/aleksis/core/frontend/app/apollo.js +++ b/aleksis/core/frontend/app/apollo.js @@ -90,6 +90,7 @@ const apolloOpts = { vm.$root.offline = true; } }, + fetchPolicy: "cache-and-network", }, }, }; diff --git a/aleksis/core/frontend/components/LegacyBaseTemplate.vue b/aleksis/core/frontend/components/LegacyBaseTemplate.vue index 324882b44c5efc85e4bef9c9fcce026cf1728320..25bf5e903e40bf03163472d73e65cc7f84fd5972 100644 --- a/aleksis/core/frontend/components/LegacyBaseTemplate.vue +++ b/aleksis/core/frontend/components/LegacyBaseTemplate.vue @@ -77,13 +77,13 @@ export default { const title = this.$refs.contentIFrame.contentWindow.document.title; this.$root.$setPageTitle(title); - // Adapt height of IFrame according to the height of its contents once and listen to resize events + // Adapt height of IFrame according to the height of its contents once and observe height changes this.iFrameHeight = this.$refs.contentIFrame.contentDocument.body.scrollHeight; - this.$refs.contentIFrame.contentWindow.onresize = () => { + new ResizeObserver(() => { this.iFrameHeight = this.$refs.contentIFrame.contentDocument.body.scrollHeight; - }; + }).observe(this.$refs.contentIFrame.contentDocument.body) this.$root.contentLoading = false; }, diff --git a/aleksis/core/vite.config.js b/aleksis/core/vite.config.js index 2b73a5f14dd8096530c7fd64356302cd47943979..604dbdae5410acc61fb5699b9a797c5906ee69de 100644 --- a/aleksis/core/vite.config.js +++ b/aleksis/core/vite.config.js @@ -239,7 +239,7 @@ export default defineConfig({ plugins: [ { fetchDidSucceed: async ({ request, response }) => { - if (response.ok) { + if (response.status < 400) { return response; } throw new Error(