summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/boards/index.js
diff options
context:
space:
mode:
authorJohann Hubert Sonntagbauer <johann.sonntagbauer@gmail.com>2018-10-02 10:00:58 +0000
committerPhil Hughes <me@iamphill.com>2018-10-02 10:00:58 +0000
commitd366ea14380b828daadce14023f0d623b87fe0b3 (patch)
tree07cf7cb229bfc78a3f0522bf127a25f765bae7ee /app/assets/javascripts/boards/index.js
parent7287fd09e264ad5b8efceab4b1919c92769856b9 (diff)
downloadgitlab-ce-d366ea14380b828daadce14023f0d623b87fe0b3.tar.gz
circumvent browser cache on browser back navigation
Diffstat (limited to 'app/assets/javascripts/boards/index.js')
-rw-r--r--app/assets/javascripts/boards/index.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/assets/javascripts/boards/index.js b/app/assets/javascripts/boards/index.js
index 662363a6f26..caa6ce84335 100644
--- a/app/assets/javascripts/boards/index.js
+++ b/app/assets/javascripts/boards/index.js
@@ -25,6 +25,7 @@ import './components/board_sidebar';
import './components/new_list_dropdown';
import BoardAddIssuesModal from './components/modal/index.vue';
import '~/vue_shared/vue_resource_interceptor';
+import { NavigationType } from '~/lib/utils/common_utils';
export default () => {
const $boardApp = document.getElementById('board-app');
@@ -32,6 +33,16 @@ export default () => {
window.gl = window.gl || {};
+ // check for browser back and trigger a hard reload to circumvent browser caching.
+ window.addEventListener('pageshow', (event) => {
+ const isNavTypeBackForward = window.performance &&
+ window.performance.navigation.type === NavigationType.TYPE_BACK_FORWARD;
+
+ if (event.persisted || isNavTypeBackForward) {
+ window.location.reload();
+ }
+ });
+
if (gl.IssueBoardsApp) {
gl.IssueBoardsApp.$destroy(true);
}