Skip to content

Commit

Permalink
fix: check for home page cache issue
Browse files Browse the repository at this point in the history
re #728

Signed-off-by: Pranav C <pranavxc@gmail.com>
  • Loading branch information
pranavxc committed Dec 7, 2021
1 parent dfb4ad0 commit 323da23
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 10 deletions.
18 changes: 18 additions & 0 deletions packages/nc-gui/app.html
Original file line number Diff line number Diff line change
@@ -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 changes: 13 additions & 10 deletions packages/nc-gui/plugins/projectLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 323da23

Please sign in to comment.