Compare commits

...
3 changed files with 18 additions and 6 deletions
@@ -125,7 +125,7 @@ export default {
"
data-testid="app-title"
@input="v$.app.title.$touch"
@blur="v$.slug.$touch"
@blur="v$.app.title.$touch"
/>
<woot-input
v-model="app.content.url"
@@ -1,4 +1,5 @@
import types from '../../mutation-types';
import * as Sentry from '@sentry/vue';
export const mutations = {
[types.SET_CONTACT_UI_FLAG]($state, data) {
@@ -48,12 +49,23 @@ export const mutations = {
[types.DELETE_CONTACT]: ($state, id) => {
const index = $state.sortOrder.findIndex(item => item === id);
$state.sortOrder.splice(index, 1);
$state.records[id] = null;
delete $state.records[id];
},
[types.UPDATE_CONTACTS_PRESENCE]: ($state, data) => {
Object.values($state.records).forEach(element => {
const availabilityStatus = data[element.id];
let availabilityStatus;
try {
availabilityStatus = data[element.id];
} catch (error) {
Sentry.setContext('contact is undefined', {
records: $state.records,
data: data,
});
Sentry.captureException(error);
return;
}
if (availabilityStatus) {
$state.records[element.id].availability_status = availabilityStatus;
} else {
@@ -33,7 +33,7 @@ export const mutations = {
// On reconnect, if there is existing notification with same primary_actor_id,
// it will be deleted and the new one will be added. So it will solve with duplicate notification
if (existingNotification) {
$state.records[existingNotification.id] = undefined;
delete $state.records[existingNotification.id];
}
$state.records[notification.id] = {
@@ -72,7 +72,7 @@ export const mutations = {
},
[types.DELETE_NOTIFICATION]($state, data) {
const { notification, unread_count: unreadCount, count } = data;
$state.records[notification.id] = undefined;
delete $state.records[notification.id];
$state.meta.unreadCount = unreadCount;
$state.meta.count = count;
},
@@ -83,7 +83,7 @@ export const mutations = {
[types.DELETE_READ_NOTIFICATIONS]: $state => {
Object.values($state.records).forEach(item => {
if (item.read_at) {
$state.records[item.id] = undefined;
delete $state.records[item.id];
}
});
},