diff --git a/src/utils/WidgetUtils.js b/src/utils/WidgetUtils.js index 237db823659..36907da5abe 100644 --- a/src/utils/WidgetUtils.js +++ b/src/utils/WidgetUtils.js @@ -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())); // Delete existing widget with ID try {