You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Put always-on-screen widgets in top left
always-on-screen widgets now appear in the top-left where the call preview normally is if you're not in the room that they're in. Fixes https://github.com/vector-im/riot-web/issues/7007 Based off https://github.com/matrix-org/matrix-react-sdk/pull/2053
This commit is contained in:
@@ -32,6 +32,9 @@ class ActiveWidgetStore {
|
||||
|
||||
// A WidgetMessaging instance for each widget ID
|
||||
this._widgetMessagingByWidgetId = {};
|
||||
|
||||
// What room ID each widget is associated with (if it's a room widget)
|
||||
this._roomIdByWidgetId = {};
|
||||
}
|
||||
|
||||
setWidgetPersistence(widgetId, val) {
|
||||
@@ -46,6 +49,10 @@ class ActiveWidgetStore {
|
||||
return this._persistentWidgetId === widgetId;
|
||||
}
|
||||
|
||||
getPersistentWidgetId() {
|
||||
return this._persistentWidgetId;
|
||||
}
|
||||
|
||||
setWidgetCapabilities(widgetId, caps) {
|
||||
this._capsByWidgetId[widgetId] = caps;
|
||||
}
|
||||
@@ -76,6 +83,18 @@ class ActiveWidgetStore {
|
||||
delete this._widgetMessagingByWidgetId[widgetId];
|
||||
}
|
||||
}
|
||||
|
||||
getRoomId(widgetId) {
|
||||
return this._roomIdByWidgetId[widgetId];
|
||||
}
|
||||
|
||||
setRoomId(widgetId, roomId) {
|
||||
this._roomIdByWidgetId[widgetId] = roomId;
|
||||
}
|
||||
|
||||
delRoomId(widgetId) {
|
||||
delete this._roomIdByWidgetId[widgetId];
|
||||
}
|
||||
}
|
||||
|
||||
if (global.singletonActiveWidgetStore === undefined) {
|
||||
|
||||
Reference in New Issue
Block a user