Browse Source

fix: check for home page cache issue

re #728

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/843/head
Pranav C 3 years ago
parent
commit
323da230d0
  1. 18
      packages/nc-gui/app.html
  2. 23
      packages/nc-gui/plugins/projectLoader.js

18
packages/nc-gui/app.html

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html {{ HTML_ATTRS }}>
<head {{ HEAD_ATTRS }}>
{{ HEAD }}
</head>
<body {{ BODY_ATTRS }}>
{{ APP }}
</body>
<script>
setTimeout(() => {
if (document.getElementById('nuxt-loading')) {
if (!(window.$nuxt && window.$nuxt._isDev) && confirm('If you upgraded NocoDB, please click OK.')) {
window.location.reload(true)
}
}
}, 16000)
</script>
</html>

23
packages/nc-gui/plugins/projectLoader.js

@ -49,17 +49,20 @@ export default async({ store, redirect, $axios, $toast, route }) => {
}
)
// window.onNuxtReady(async () => {
console.log('===== Within nuxt ready handler =====')
await store.dispatch('project/ActLoadProjectInfo')
console.log('==== Projectinfo ', store.state.project.projectInfo)
if (!store.state.project.projectInfo.projectHasDb) {
redirect('/')
} else if (store.state.project.projectInfo.projectHasAdmin === false) {
redirect('/')
try {
// window.onNuxtReady(async () => {
console.log('===== Within nuxt ready handler =====')
await store.dispatch('project/ActLoadProjectInfo')
console.log('==== Projectinfo ', store.state.project.projectInfo)
if (!store.state.project.projectInfo.projectHasDb) {
redirect('/')
} else if (store.state.project.projectInfo.projectHasAdmin === false) {
redirect('/')
}
// })
} catch (e) {
console.log(e)
}
// })
// fetch latest release info
const fetchReleaseInfo = async() => {
try {

Loading…
Cancel
Save