diff --git a/app/diario-bordo.html b/app/diario-bordo.html index 89f2b28..24da53d 100644 --- a/app/diario-bordo.html +++ b/app/diario-bordo.html @@ -2531,7 +2531,7 @@ Hora: {HORA} - + @@ -4248,7 +4248,13 @@ function saveContactsConfig(){ let heartbeatInterval=null; let cloudAutoSyncTimeout=null; -function cloudConfigured(){return state.cloud&&state.cloud.url&&state.cloud.token} +function cloudConfigured(){ + if(!state.cloud||!state.cloud.url)return false; + // Auth: tem JWT (login Google/email) OU BOAT_TOKEN (avançado/legacy) + if(state.auth&&state.auth.accessToken)return true; + if(state.cloud.token)return true; + return false; +} function cloudUrl(path){return state.cloud.url.replace(/\/$/,'')+path} async function cloudFetch(path,opts={}){ @@ -4274,9 +4280,14 @@ const GOOGLE_CLIENT_ID_FRONTEND='989184529532-uceun7l7a12e63fdrkilnh8vml0v0lv4.a function maybeShowWelcome(){ const ws=document.getElementById('welcome-screen'); if(!ws)return; - // Mostra se: nuvem não configurada E user não está logado E nunca dispensou + // Mostra welcome SE: não tem auth nem token configurado E não dispensou explicitamente const dismissed=localStorage.getItem('shivao_welcome_dismissed')==='1'; - const needsSetup=(!cloudConfigured()||!state.auth)&&!dismissed; + // Logado via JWT (Google/email) → não precisa welcome + const hasJwtAuth=state.auth&&state.auth.accessToken; + // Conectado via BOAT_TOKEN avançado → não precisa welcome + const hasBoatToken=state.cloud&&state.cloud.token; + const isAuthenticated=hasJwtAuth||hasBoatToken; + const needsSetup=!isAuthenticated&&!dismissed; ws.style.display=needsSetup?'flex':'none'; // Se mostrar, prepara o Google Sign-In quando carregar if(needsSetup&&window.google?.accounts?.id){ diff --git a/mobile/android/app/build.gradle b/mobile/android/app/build.gradle index 42376e7..4c0fecf 100644 --- a/mobile/android/app/build.gradle +++ b/mobile/android/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "br.com.pontualtech.shivao" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 10 - versionName "1.7.0" + versionCode 11 + versionName "1.7.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/mobile/package.json b/mobile/package.json index 5aa9d0e..1357e3a 100644 --- a/mobile/package.json +++ b/mobile/package.json @@ -1,6 +1,6 @@ { "name": "shivao-mobile", - "version": "1.7.0", + "version": "1.7.1", "description": "Shivao app nativo (Capacitor wrapper Android/iOS)", "main": "index.js", "type": "module", diff --git a/server/public/index.html b/server/public/index.html index 89f2b28..24da53d 100644 --- a/server/public/index.html +++ b/server/public/index.html @@ -2531,7 +2531,7 @@ Hora: {HORA} - + @@ -4248,7 +4248,13 @@ function saveContactsConfig(){ let heartbeatInterval=null; let cloudAutoSyncTimeout=null; -function cloudConfigured(){return state.cloud&&state.cloud.url&&state.cloud.token} +function cloudConfigured(){ + if(!state.cloud||!state.cloud.url)return false; + // Auth: tem JWT (login Google/email) OU BOAT_TOKEN (avançado/legacy) + if(state.auth&&state.auth.accessToken)return true; + if(state.cloud.token)return true; + return false; +} function cloudUrl(path){return state.cloud.url.replace(/\/$/,'')+path} async function cloudFetch(path,opts={}){ @@ -4274,9 +4280,14 @@ const GOOGLE_CLIENT_ID_FRONTEND='989184529532-uceun7l7a12e63fdrkilnh8vml0v0lv4.a function maybeShowWelcome(){ const ws=document.getElementById('welcome-screen'); if(!ws)return; - // Mostra se: nuvem não configurada E user não está logado E nunca dispensou + // Mostra welcome SE: não tem auth nem token configurado E não dispensou explicitamente const dismissed=localStorage.getItem('shivao_welcome_dismissed')==='1'; - const needsSetup=(!cloudConfigured()||!state.auth)&&!dismissed; + // Logado via JWT (Google/email) → não precisa welcome + const hasJwtAuth=state.auth&&state.auth.accessToken; + // Conectado via BOAT_TOKEN avançado → não precisa welcome + const hasBoatToken=state.cloud&&state.cloud.token; + const isAuthenticated=hasJwtAuth||hasBoatToken; + const needsSetup=!isAuthenticated&&!dismissed; ws.style.display=needsSetup?'flex':'none'; // Se mostrar, prepara o Google Sign-In quando carregar if(needsSetup&&window.google?.accounts?.id){ diff --git a/server/src/index.js b/server/src/index.js index 38a3f0d..e88e4fa 100644 --- a/server/src/index.js +++ b/server/src/index.js @@ -347,7 +347,7 @@ app.get('/.well-known/assetlinks.json', (req, res) => { }); // Atalho: /apk redireciona pra última APK release no Forgejo -const LATEST_APK_URL = 'https://git.pontualtech.work/karlao/shivao-projeto/releases/download/v1.7.0/Shivao-v1.7.0.apk'; +const LATEST_APK_URL = 'https://git.pontualtech.work/karlao/shivao-projeto/releases/download/v1.7.1/Shivao-v1.7.1.apk'; app.get('/apk', (req, res) => res.redirect(302, LATEST_APK_URL)); // Página A4 imprimível com QR Code + instruções (cola no barco/marina)