Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
corrideat committed Nov 30, 2024
1 parent 99aa0c0 commit 1b276c8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion frontend/controller/app/identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 1 addition & 7 deletions frontend/controller/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion frontend/model/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {})
}
},
Expand Down
4 changes: 3 additions & 1 deletion shared/domains/chelonia/chelonia.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1b276c8

Please sign in to comment.