mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
DEV: Use object spread instead of Object.assign (#30407)
This commit is contained in:
@ -558,17 +558,13 @@ export default class ChatChannel extends Component {
|
||||
}
|
||||
|
||||
try {
|
||||
const params = {
|
||||
await this.chatApi.sendMessage(this.args.channel.id, {
|
||||
message: message.message,
|
||||
in_reply_to_id: message.inReplyTo?.id,
|
||||
staged_id: message.id,
|
||||
upload_ids: message.uploads.map((upload) => upload.id),
|
||||
};
|
||||
|
||||
await this.chatApi.sendMessage(
|
||||
this.args.channel.id,
|
||||
Object.assign({}, params, extractCurrentTopicInfo(this))
|
||||
);
|
||||
...extractCurrentTopicInfo(this),
|
||||
});
|
||||
|
||||
if (!this.capabilities.isIOS) {
|
||||
this.scrollToLatestMessage();
|
||||
|
@ -442,17 +442,16 @@ export default class ChatThread extends Component {
|
||||
}
|
||||
|
||||
try {
|
||||
const params = {
|
||||
message: message.message,
|
||||
in_reply_to_id: null,
|
||||
staged_id: message.id,
|
||||
upload_ids: message.uploads.map((upload) => upload.id),
|
||||
thread_id: message.thread.id,
|
||||
};
|
||||
|
||||
const response = await this.chatApi.sendMessage(
|
||||
this.args.thread.channel.id,
|
||||
Object.assign({}, params, extractCurrentTopicInfo(this))
|
||||
{
|
||||
message: message.message,
|
||||
in_reply_to_id: null,
|
||||
staged_id: message.id,
|
||||
upload_ids: message.uploads.map((upload) => upload.id),
|
||||
thread_id: message.thread.id,
|
||||
...extractCurrentTopicInfo(this),
|
||||
}
|
||||
);
|
||||
|
||||
this.args.thread.currentUserMembership ??=
|
||||
|
@ -81,7 +81,7 @@ export default class ChatFabricators {
|
||||
status: args.status || CHANNEL_STATUSES.open,
|
||||
slug:
|
||||
chatable?.slug || chatable instanceof Category ? chatable.slug : null,
|
||||
meta: Object.assign({ can_delete_self: true }, args.meta || {}),
|
||||
meta: { can_delete_self: true, ...(args.meta || {}) },
|
||||
archive_failed: args.archive_failed ?? false,
|
||||
memberships_count: args.memberships_count ?? 0,
|
||||
});
|
||||
|
Reference in New Issue
Block a user