Skip to content

Commit

Permalink
TAB-481 electron
Browse files Browse the repository at this point in the history
  • Loading branch information
evandor committed Jan 24, 2024
1 parent e811f97 commit 26f798e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 16 deletions.
21 changes: 9 additions & 12 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,20 @@

<script setup lang="ts">
import {LocalStorage, useQuasar} from "quasar";
import {useAuth0, User} from "@auth0/auth0-vue";
import {ref, watchEffect} from "vue";
import PouchDbPersistenceService from "src/services/PouchDbPersistenceService";
import AppService from "src/services/AppService";
import {useAuthStore} from "stores/authStore";
import {Logz} from "src/services/logz/Logz";
import {EventEmitter} from "events";
import {logtail} from "boot/logtail";
import {getAuth, isSignInWithEmailLink, onAuthStateChanged, signInWithEmailLink, UserCredential} from "firebase/auth";
import {CURRENT_USER_EMAIL} from "boot/constants";
import {collection, doc, getDoc, getDocs} from "firebase/firestore";
import {firestore} from "boot/firebase";
import {Account} from "src/models/Account";
import GitPersistentService from "src/services/persistence/GitPersistentService";
const $q = useQuasar()
const auth0 = useAuth0()
//const auth0 = useAuth0()
const authStore = useAuthStore()
// https://stackoverflow.com/questions/9768444/possible-eventemitter-memory-leak-detected
Expand Down Expand Up @@ -133,22 +130,22 @@ const redirect = ref(true)
watchEffect(() => {
// TODO improve
if (process.env.MODE === 'electron') {
if (process.env.MODE === 'electronXXX') {
console.log("watching auth effect:", isAuthenticated.value, redirect.value)
if (redirect.value && isAuthenticated.value && authStore.user?.name) {
redirect.value = false
if (auth0.user.value) {
//if (auth0.user.value) {
//authStore.setUser(auth0.user.value)
}
//}
//console.log("setting auth0", auth0)
//authStore.setAuth0(auth0)
PouchDbPersistenceService.initRemoteDb()
.then(() => {
console.log("calling appService init")
AppService.init()
})
// PouchDbPersistenceService.initRemoteDb()
// .then(() => {
// console.log("calling appService init")
// AppService.init()
// })
// Logz.info({"message": "user logged in (electron)", "username": auth0.user.value?.name})
}
Expand Down
2 changes: 1 addition & 1 deletion src/router/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const routes: RouteRecordRaw[] = [
{
path: '/',
// @ts-ignore
redirect: (process.env.MODE === 'pwa') ?
redirect: (process.env.MODE === 'pwa' || process.env.MODE === 'electron') ?
'/tabsets' : // use case: sharing tabset, opening link, import in PWA for anonymous user
//'/sidepanel' : // use case: ???
'/sidepanel'
Expand Down
3 changes: 2 additions & 1 deletion src/services/ChromeApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ function runHousekeeping() {
})


TabService.checkScheduled()
// TODO
//TabService.checkScheduled()
}


Expand Down
2 changes: 0 additions & 2 deletions src/services/TabService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class TabService {
return Promise.resolve({})
}



checkScheduled() {
const tabs = useTabsStore().scheduledTabs
const dueTabs: Tab[] = []
Expand Down

0 comments on commit 26f798e

Please sign in to comment.