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 () => { try {
console.log('===== Within nuxt ready handler =====') // window.onNuxtReady(async () => {
await store.dispatch('project/ActLoadProjectInfo') console.log('===== Within nuxt ready handler =====')
console.log('==== Projectinfo ', store.state.project.projectInfo) await store.dispatch('project/ActLoadProjectInfo')
if (!store.state.project.projectInfo.projectHasDb) { console.log('==== Projectinfo ', store.state.project.projectInfo)
redirect('/') if (!store.state.project.projectInfo.projectHasDb) {
} else if (store.state.project.projectInfo.projectHasAdmin === false) { redirect('/')
redirect('/') } else if (store.state.project.projectInfo.projectHasAdmin === false) {
redirect('/')
}
// })
} catch (e) {
console.log(e)
} }
// })
// fetch latest release info // fetch latest release info
const fetchReleaseInfo = async() => { const fetchReleaseInfo = async() => {
try { try {

Loading…
Cancel
Save