diff --git a/app/Models/WebSocketDialog.php b/app/Models/WebSocketDialog.php index d12bd1dad..138431165 100644 --- a/app/Models/WebSocketDialog.php +++ b/app/Models/WebSocketDialog.php @@ -121,7 +121,7 @@ class WebSocketDialog extends AbstractModel } if ($hasData === true) { $msgBuilder = WebSocketDialogMsg::whereDialogId($this->id); - $this->has_tag = $msgBuilder->clone()->where('tag', '>', 0)->exists(); + $this->has_tag = $msgBuilder->clone()->whereMtype('tag')->exists(); $this->has_image = $msgBuilder->clone()->whereMtype('image')->exists(); $this->has_file = $msgBuilder->clone()->whereMtype('file')->exists(); $this->has_link = $msgBuilder->clone()->whereLink(1)->exists(); diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index 0ff76a6cf..79e5c1821 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -1929,11 +1929,24 @@ export default { } else if ($A.isJson(data)) { const index = state.cacheDialogs.findIndex(({id}) => id == data.dialog_id); if (index > -1) { - dispatch("saveDialog", { + const updateData = { id: data.dialog_id, last_msg: data, last_at: $A.formatDate("Y-m-d H:i:s") - }); + } + if (data.mtype == 'tag') { + updateData.has_tag = true; + } + if (data.mtype == 'image') { + updateData.has_image = true; + } + if (data.mtype == 'file') { + updateData.has_file = true; + } + if (data.link) { + updateData.has_link = true; + } + dispatch("saveDialog", updateData); } else { dispatch("getDialogOne", data.dialog_id).catch(() => {}) }