Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
evandor committed Feb 17, 2024
1 parent bcbeefe commit 07caefd
Show file tree
Hide file tree
Showing 3 changed files with 170 additions and 156 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"test:e2e:showReport": "npx playwright show-report",
"test:specificTest": "npx playwright test addFirstTabset",
"test:specificTest:debug": "npx playwright test addFirstTabset --debug",
"build pwa & deploy to india032": "quasar build -m pwa && scp -r -P 222 dist/pwa/* [email protected]:/home/carsten/tabsets/pwa.tabsets.net",
"build pwa.prd & deploy to india032": "mv .env .env.tmp && cp .prd.env .env && quasar build -m pwa && scp -r -P 222 dist/pwa/* [email protected]:/home/carsten/tabsets/pwa.tabsets.net && mv .env.tmp .env",
"build pwa.dev & deploy to india032": "mv .env .env.tmp && cp .dev.env .env && quasar build -m pwa && scp -r -P 222 dist/pwa/* [email protected]:/home/carsten/tabsets/pwa.dev.tabsets.net && mv .env.tmp .env"
},
"dependencies": {
Expand Down
14 changes: 2 additions & 12 deletions src/services/AppService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,13 @@ import {User} from "firebase/auth";
import {Account} from "src/models/Account";
import FsPersistenceService from "src/services/persistence/FsPersistenceService";

// function useGitStore(st: SyncType, su: string | undefined) {
// const isAuthenticated = useAuthStore().isAuthenticated()
// console.debug("%cisAuthenticated", "font-weight:bold", isAuthenticated)
// return isAuthenticated && st && (st === SyncType.GITHUB || st === SyncType.MANAGED_GIT) && su
// }

function dbStoreToUse(st: SyncType, su: string | undefined) {
const isAuthenticated = useAuthStore().isAuthenticated()
if (!isAuthenticated) {
console.debug("%not authenticated", "font-weight:bold")
return useDB(undefined).db
}
if (st && (st === SyncType.GITHUB || st === SyncType.MANAGED_GIT) && su) {
if (st && (st === SyncType.GITHUB) && su) {
console.debug("%csyncType " + st, "font-weight:bold")
return useDB(undefined).gitDb
}
Expand Down Expand Up @@ -98,7 +92,6 @@ class AppService {

searchStore.init().catch((err) => console.error(err))


// init db
await IndexedDbPersistenceService.init("db")

Expand All @@ -118,9 +111,6 @@ class AppService {
// sync features
const syncType = useAuthStore().getAccount()?.userData?.sync?.type || SyncType.NONE
const syncUrl = useAuthStore().getAccount()?.userData?.sync?.url
// let dbOrGitDb = useGitStore(syncType, syncUrl) ?
// useDB(undefined).gitDb :
// useDB(undefined).db

let persistenceStore = dbStoreToUse(syncType, syncUrl)

Expand Down Expand Up @@ -191,7 +181,7 @@ class AppService {

useUiStore().appLoading = undefined

// tabsets not in bex mode means running on "shared.tabsets.net"
// tabsets not in bex mode means running on "pwa.tabsets.net"
// probably running an import ("/imp/:sharedId")
// we do not want to go to the welcome back
// console.log("checking for welcome page", tabsStore.tabsets.size === 0, quasar.platform.is.bex, !useAuthStore().isAuthenticated())
Expand Down
Loading

0 comments on commit 07caefd

Please sign in to comment.