Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix integration manager not updating when set #3510

Merged
merged 1 commit into from
Oct 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/utils/WidgetUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,9 @@ export default class WidgetUtils {
};

const client = MatrixClientPeg.get();
const userWidgets = WidgetUtils.getUserWidgets();
// Get the current widgets and clone them before we modify them, otherwise
// we'll modify the content of the old event.
const userWidgets = JSON.parse(JSON.stringify(WidgetUtils.getUserWidgets()));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Object.assign({}, thingToClone) should also work and skips the overhead of JSON in the middle.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, although only shallow, although that would probably suffice in this case...


// Delete existing widget with ID
try {
Expand Down