mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 01:05:53 -04:00
Don't replace sticker picker unless we have to
This commit is contained in:
parent
77d652d6c0
commit
a3952a880c
@ -90,11 +90,18 @@ export class StickerpickerComponent implements OnInit {
|
||||
const stickerPicker = widgets.response.find(w => w.content && w.content.type === "m.stickerpicker");
|
||||
const widgetId = stickerPicker ? ((<any>stickerPicker).id || stickerPicker.state_key) : "dimension-stickerpicker-" + (new Date().getTime());
|
||||
|
||||
const targetUrl = this.window.location.origin + "/widgets/stickerpicker";
|
||||
|
||||
if (widgets.response[0].content.url === targetUrl) {
|
||||
console.warn("Not replacing Dimension sticker picker");
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("Force-setting new widget of ID " + widgetId);
|
||||
await this.scalarClient.setUserWidget({
|
||||
id: widgetId,
|
||||
type: WIDGET_STICKER_PICKER[0],
|
||||
url: this.window.location.origin + "/widgets/stickerpicker",
|
||||
url: targetUrl,
|
||||
data: {
|
||||
dimension: {
|
||||
wrapperId: "stickerpicker",
|
||||
|
Loading…
Reference in New Issue
Block a user