Move to token based identifiers

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2019-10-16 15:32:40 +02:00
Родитель 9ccbda1016
Коммит d64429028f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 7076EA9751AACDDA
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -41,7 +41,7 @@ const mutations = {
* @param {object} conversation the conversation;
*/
addConversation(state, conversation) {
Vue.set(state.conversations, conversation.id, conversation)
Vue.set(state.conversations, conversation.token, conversation)
},
/**
* Creates a key-value pair with conversation id and name
@ -49,11 +49,11 @@ const mutations = {
*
* @param {object} state current state object;
* @param {object} object destructuring object;
* @param {int} object.id conversation id;
* @param {string} object.token conversation token;
* @param {string} object.displayName conversation name;
*/
indexConversationName(state, { id, displayName }) {
Vue.set(state.conversationsNames, id, displayName)
indexConversationName(state, { token, displayName }) {
Vue.set(state.conversationsNames, token, displayName)
},
/**
* Deletes a conversation from the store.
@ -61,8 +61,8 @@ const mutations = {
* @param {object} conversation the message;
*/
deleteConversation(state, conversation) {
Vue.delete(state.conversations, conversation.id)
Vue.delete(state.conversationsNames, conversation.id)
Vue.delete(state.conversations, conversation.token)
Vue.delete(state.conversationsNames, conversation.token)
}
}