no message

This commit is contained in:
kuaifan 2022-07-01 16:27:13 +08:00
parent a9950a4365
commit 08883ce558
2 changed files with 16 additions and 3 deletions

View File

@ -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();

View File

@ -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(() => {})
}