Skip to content

Commit

Permalink
Bugfixes (#2514)
Browse files Browse the repository at this point in the history
  • Loading branch information
corrideat authored Jan 17, 2025
1 parent 4e19087 commit 1ee4525
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
18 changes: 17 additions & 1 deletion frontend/controller/serviceworkers/sw-primary.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,23 @@ sbp('sbp/selectors/register', {

return computedGetters
}
})()
})(),
// For compatibility for old contracts.
// TODO: This is to be deleted in a later release, once contracts are recreated.
'state/vuex/commit': (key, data) => {
switch (key) {
case 'deleteChatRoomScrollPosition':
case 'setChatRoomScrollPosition':
return sbp('okTurtles.events/emit', NEW_CHATROOM_UNREAD_POSITION, data)
// These are handled by events
case 'removeNotification':
return
case 'setCurrentChatRoomId':
return
}

throw new Error(`Invalid selector 'state/vuex/commit': Not allowed in SW. (key: ${key})`)
}
})

const ourLocation = new URL(self.location)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const periodicNotificationEntries: {
const comparison = comparePeriodStamps(nextPeriod, now)

return (
rootGetters.ourGroupProfileForGroup(rootState[gId]).incomeDetailsType === 'pledgeAmount' &&
rootGetters.ourGroupProfileForGroup(rootState[gId])?.incomeDetailsType === 'pledgeAmount' &&
(comparison > 0 && comparison < DAYS_MILLIS * 7) &&
(rootGetters.ourPaymentsForGroup(rootState[gId])?.todo.length > 0) &&
!myNotificationHas(item => item.type === 'NEAR_DISTRIBUTION_END' && item.data.period === currentPeriod, gId)
Expand Down Expand Up @@ -84,7 +84,7 @@ const periodicNotificationEntries: {

this.nextDistributionPeriod = groupIds.map((gId) => {
const profile = rootGetters.ourGroupProfileForGroup(rootState[gId])
if (!profile.incomeDetailsType) {
if (!profile?.incomeDetailsType) {
// if income-details are not set yet, ignore.
return null
}
Expand Down

0 comments on commit 1ee4525

Please sign in to comment.