diff --git a/src/lib/push_notifications_plugin.js b/src/lib/push_notifications_plugin.js index 9eff52fff..7d44625c2 100644 --- a/src/lib/push_notifications_plugin.js +++ b/src/lib/push_notifications_plugin.js @@ -83,6 +83,7 @@ export const vuexPushNotificationsPlugin = (store) => { mutation.type === 'setCurrentUser' || mutation.type === 'clearCurrentUser' ) { + console.log(!!user, permissionGranted, enabled) if (user && permissionGranted && enabled) { return store.dispatch('registerPushNotifications') } else { diff --git a/src/services/new_api/oauth.js b/src/services/new_api/oauth.js index b803e2146..ead2153a6 100644 --- a/src/services/new_api/oauth.js +++ b/src/services/new_api/oauth.js @@ -20,8 +20,10 @@ export const getJsonOrError = async (response) => { } export const createApp = (instance) => { + console.log('NAP', instance) const url = `${instance}/api/v1/apps` const form = new window.FormData() + console.log(url) form.append('client_name', 'PleromaFE') form.append('website', 'https://pleroma.social') diff --git a/src/services/style_setter/style_setter.js b/src/services/style_setter/style_setter.js index d2e8d97e8..5c0a7326b 100644 --- a/src/services/style_setter/style_setter.js +++ b/src/services/style_setter/style_setter.js @@ -136,6 +136,7 @@ const generateTheme = (inputRuleset, callbacks, debug) => { export const tryLoadCache = async () => { console.info('Trying to load compiled theme data from cache') const cache = await localforage.getItem('pleromafe-theme-cache') + console.log(cache.checksum) if (!cache) return null try { if (cache.engineChecksum === getEngineChecksum() && diff --git a/src/stores/oauth.js b/src/stores/oauth.js index 2a79c2fa9..ef0f5ba35 100644 --- a/src/stores/oauth.js +++ b/src/stores/oauth.js @@ -83,6 +83,7 @@ export const useOAuthStore = defineStore('oauth', { }, async getAppToken() { const instance = useInstanceStore().server + console.log(this.clientId) const res = await getClientToken({ clientId: this.clientId, clientSecret: this.clientSecret, diff --git a/src/stores/sync_config.js b/src/stores/sync_config.js index e56cf3210..244489074 100644 --- a/src/stores/sync_config.js +++ b/src/stores/sync_config.js @@ -80,6 +80,7 @@ export const _moveItemInArray = (array, value, movement) => { } const _wrapData = (data, userName) => { + console.log('WRAP') return { ...data, _user: userName, @@ -413,6 +414,8 @@ export const _resetPrefs = ( } export const _doMigrations = async (data, setPreference) => { + console.log('TEST', data._version) + if (data._version < VERSION) { console.debug( 'Data has older version, seeing if there any migrations that can be applied', diff --git a/src/stores/user_highlight.js b/src/stores/user_highlight.js index 4723d4c05..09efdf7ad 100644 --- a/src/stores/user_highlight.js +++ b/src/stores/user_highlight.js @@ -71,27 +71,27 @@ export const _getRecentData = (cache, live, isTest) => { if (!liveValid && cacheValid) { result.needUpload = true console.debug( - '[HIGHLIGHT] Nothing valid stored on server, assuming cache to be source of truth', + 'Nothing valid stored on server, assuming cache to be source of truth', ) result.recent = cache result.stale = live } else if (!cacheValid && liveValid) { console.debug( - '[HIGHLIGHT] Valid storage on server found, no local cache found, using live as source of truth', + 'Valid storage on server found, no local cache found, using live as source of truth', ) result.recent = live result.stale = cache } else if (cacheValid && liveValid) { - console.debug('[HIGHLIGHT] Both sources have valid data, figuring things out...') + console.debug('Both sources have valid data, figuring things out...') if (live._timestamp === cache._timestamp) { console.debug( - '[HIGHLIGHT] Same timestamp on both sources, source of truth irrelevant', + 'Same timestamp on both sources, source of truth irrelevant', ) result.recent = cache result.stale = live } else { console.debug( - '[HIGHLIGHT] Different timestamp, figuring out which one is more recent', + 'Different timestamp, figuring out which one is more recent', ) if (live._timestamp < cache._timestamp) { result.recent = cache @@ -102,7 +102,7 @@ export const _getRecentData = (cache, live, isTest) => { } } } else { - console.debug('[HIGHLIGHT] Both sources are invalid, start from scratch') + console.debug('Both sources are invalid, start from scratch') result.needUpload = true } @@ -281,17 +281,16 @@ export const useUserHighlightStore = defineStore('user_highlight', { Object.entries(highlight).forEach(([user, value]) => { if ((highlight[user]._migrated || 0) < 1) { dirty = true - needUpload = true this.set({ user, value: clone(value) }) vuexState.config.highlight[user]._migrated = 1 - console.debug(`[HIGHLIGHT] Migrating user ${user}: ${ JSON.stringify(value) }`) + console.debug(`Migrating user ${user}: ${ JSON.stringify(value) }`) } }) storage.setItem('vuex-lz', vuexState) if (recent === null) { console.debug( - `[HIGHLIGHT] Data is empty, initializing for ${userNew ? 'new' : 'existing'} user`, + `Data is empty, initializing for ${userNew ? 'new' : 'existing'} user`, ) recent = _wrapData({ highlight: { ...defaultState.highlight }, @@ -299,17 +298,17 @@ export const useUserHighlightStore = defineStore('user_highlight', { } if (!needUpload && recent && stale) { - console.debug('[HIGHLIGHT] Checking if data needs merging...') + console.debug('Checking if data needs merging...') // discarding timestamps const { _timestamp: _0, ...recentData } = recent const { _timestamp: _2, ...staleData } = stale dirty = !isEqual(recentData, staleData) - console.debug(`[HIGHLIGHT] Data ${dirty ? 'needs' : "doesn't need"} merging`) + console.debug(`Data ${dirty ? 'needs' : "doesn't need"} merging`) } let highlights if (dirty) { - console.debug('[HIGHLIGHT] Merging the data...') + console.debug('Merging the data...') _verifyHighlights(recent) _verifyHighlights(stale) highlights = _mergeHighlights(recent.highlight, stale.highlight)