Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small fixes regarding KV messages #2086

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions frontend/controller/actions/group.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,10 @@ export default (sbp('sbp/selectors/register', {
postpublish: null
}
})

await sbp('gi.actions/group/updateLastLoggedIn', {
contractID: params.contractID
}).catch((e) => console.error('[gi.actions/group/join] Error sending updateLastLoggedIn', e))
} catch (e) {
console.error(`[gi.actions/group/join] Error while sending key request for ${params.contractID}:`, e)
throw e
Expand Down
12 changes: 6 additions & 6 deletions frontend/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,14 @@ async function startApp () {
}
}
},
[NOTIFICATION_TYPE.KV] ([key, data]) {
[NOTIFICATION_TYPE.KV] ([key, value]) {
const rootState = sbp('state/vuex/state')
const { contractID, data: value } = data
const { contractID, data } = value

if (key === KV_KEYS.LAST_LOGGED_IN && value) {
Vue.set(rootState.lastLoggedIn, contractID, value)
} else if (key === KV_KEYS.UNREAD_MESSAGES && value) {
sbp('state/vuex/commit', 'setUnreadMessages', value)
if (key === KV_KEYS.LAST_LOGGED_IN && data) {
Vue.set(rootState.lastLoggedIn, contractID, data)
} else if (key === KV_KEYS.UNREAD_MESSAGES && data) {
sbp('state/vuex/commit', 'setUnreadMessages', data)
}
}
}
Expand Down
Loading