From 1b276c8710e77e7d9f3513a8d5882a8e38310ccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Iv=C3=A1n=20Vieitez=20Parra?= <3857362+corrideat@users.noreply.github.com> Date: Sat, 30 Nov 2024 20:03:00 +0000 Subject: [PATCH] Cleanup --- frontend/controller/app/identity.js | 1 - frontend/controller/router.js | 8 +------- frontend/model/state.js | 1 - shared/domains/chelonia/chelonia.js | 4 +++- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/frontend/controller/app/identity.js b/frontend/controller/app/identity.js index 8bbb7d9a8..a8fd3c9e4 100644 --- a/frontend/controller/app/identity.js +++ b/frontend/controller/app/identity.js @@ -67,7 +67,6 @@ sbp('okTurtles.events/on', LOGIN, async ({ identityContractID, encryptionParams, throw new Error('Received login event but there already is an active session') } const cheloniaState = cloneDeep(await sbp('chelonia/rootState')) - console.error('@@@@CHELONIA STATE', cheloniaState) // If `state` is set, process it and replace Vuex state with it if (state) { // Exclude contracts from the state diff --git a/frontend/controller/router.js b/frontend/controller/router.js index 7a3912943..461621b4a 100644 --- a/frontend/controller/router.js +++ b/frontend/controller/router.js @@ -34,9 +34,6 @@ Vue.use(Router) const homeGuard = { guard: (to, from) => !!store.state.currentGroupId, redirect: (to, from) => { - if (!store.getters.seenWelcomeScreen) { - console.error('@@@@redirect h guard', store.state.currentGroupId) - } return ({ path: // If we haven't accepted the invite OR we haven't clicked 'Awesome' on @@ -69,10 +66,7 @@ const groupGuard = { const pendingApprovalGuard = { guard: (to, from) => store.state.currentGroupId && !store.getters.ourProfileActive, - redirect: (to, from) => { - sbp('chelonia/rootState').then(c => console.error('@@@@redirect pa guard', store.state.currentGroupId, !store.getters.ourProfileActive, to, from, new Error().stack, sbp('state/vuex/state'), c)) - return ({ path: '/pending-approval' }) - } + redirect: (to, from) => ({ path: '/pending-approval' }) } // TODO: add state machine guard and redirect to critical error page if necessary diff --git a/frontend/model/state.js b/frontend/model/state.js index 0e9f493a9..42d2e72e7 100644 --- a/frontend/model/state.js +++ b/frontend/model/state.js @@ -283,7 +283,6 @@ const mutations = { if (sbp('controller/router').history.current.path === '/join') return sbp('controller/router').push({ path: '/' }).catch(() => {}) } else if (isNewlyCreated) { - console.error('@@@@redirect state', currentGroupId) sbp('controller/router').push({ path: '/pending-approval' }).catch(() => {}) } }, diff --git a/shared/domains/chelonia/chelonia.js b/shared/domains/chelonia/chelonia.js index ed995c289..fcff2431d 100644 --- a/shared/domains/chelonia/chelonia.js +++ b/shared/domains/chelonia/chelonia.js @@ -647,9 +647,11 @@ export default (sbp('sbp/selectors/register', { // other than the Chelonia-managed websocket connection and RESTful API). 'chelonia/handleEvent': async function (event: string) { const { contractID } = GIMessage.deserializeHEAD(event) + // TODO REMOVEME if (self.registration) { - self.registration.showNotification('@@' + contractID, { body: sbp(this.config.stateSelector)[contractID] }) + self.registration.showNotification('@@@' + contractID, { body: sbp(this.config.stateSelector)[contractID] }) } + // /TODO REMOVEME return await sbp('chelonia/private/in/enqueueHandleEvent', contractID, event) }, 'chelonia/defineContract': function (contract: Object) {