Skip to content
Permalink
Browse files

wip ref store into dispatch(action)/commit(mutation)

continue turn onDispatch into action(s)/mutation(s)

[TEMP] removal of "is typing" & "seen" features
[TEMP] (in progress) removal of "moderation" feature
  • Loading branch information...
alexkuhn committed Mar 15, 2019
1 parent 451876d commit 698516fa6fb552463f44c04526da07fbb9b707d0
@@ -26,12 +26,9 @@ class Input extends odoo.core.Component {
if (!this.el.value) {
return;
}
this.env.store.messaging.dispatch({
type: 'POST_MESSAGE_ON_THREAD',
data: {
threadID: this.props.activeThreadID,
messageData: { content: this.el.value },
},
this.env.store.messaging.dispatch('postMessageOnThread', {
threadID: this.props.activeThreadID,
data: { content: this.el.value },
});
this.el.value = '';
}
@@ -38,17 +38,14 @@ class Root extends odoo.core.Component {

/**
* @private
* @param {Object} data
* @param {string|integer} data.threadID
* @param {Object} payload
* @param {string|integer} payload.threadID
*/
_selectThread(data) {
this.updateState({ activeThreadID: data.threadID });
const thread = this.env.store.messaging.state.threads[data.threadID];
_selectThread(payload) {
this.updateState({ activeThreadID: payload.threadID });
const thread = this.env.store.messaging.state.threads[payload.threadID];
if (!thread.caches['[]'].loaded) {
setTimeout(() => this.env.store.messaging.dispatch({
type: 'LOAD_MESSAGES_FROM_THREAD',
data: { threadID: thread.id },
}), 3*1000);
setTimeout(() => this.env.store.messaging.dispatch('loadMessagesFromThread', { threadID: thread.id }), 3*1000);
}
}

@@ -44,19 +44,13 @@ class ChannelAddItem extends odoo.core.Component {
return;
}
if (ui.item.special) {
this.env.store.messaging.dispatch({
type: 'CREATE_CHANNEL',
data: {
name: this._lastSearchVal,
publicStatus: ui.item.special,
type: 'multi_user_channel',
},
this.env.store.messaging.dispatch('createChannel', {
name: this._lastSearchVal,
publicStatus: ui.item.special,
type: 'multi_user_channel',
});
} else {
this.env.store.messaging.dispatch({
type: 'JOIN_CHANNEL',
data: { channelID: ui.item.id },
});
this.env.store.messaging.dispatch('joinChannel', { channelID: ui.item.id });
}
this.trigger('hide');
}
@@ -27,12 +27,9 @@ class DmChatAddItem extends odoo.core.Component {
data: { threadID: dmChat.id },
});
} else {
this.env.store.messaging.dispatch({
type: 'CREATE_CHANNEL',
data: {
partnerID,
type: 'dm_chat',
},
this.env.store.messaging.dispatch('createChannel', {
partnerID,
type: 'dm_chat',
});
}
this.trigger('hide');
Oops, something went wrong.

0 comments on commit 698516f

Please sign in to comment.
You can’t perform that action at this time.