mirror of https://github.com/vector-im/riot-web
Respect the roomState right container request for the Jitsi widget (#7033)
parent
a4e20c7b41
commit
82c2102ccb
|
@ -207,15 +207,14 @@ export class WidgetLayoutStore extends ReadyWatchingStore {
|
||||||
const isLegacyPinned = !!legacyPinned?.[widget.id];
|
const isLegacyPinned = !!legacyPinned?.[widget.id];
|
||||||
const defaultContainer = WidgetType.JITSI.matches(widget.type) ? Container.Top : Container.Right;
|
const defaultContainer = WidgetType.JITSI.matches(widget.type) ? Container.Top : Container.Right;
|
||||||
|
|
||||||
if (manualContainer === Container.Right) {
|
let targetContainer = defaultContainer;
|
||||||
rightWidgets.push(widget);
|
if (!!manualContainer || !!stateContainer) {
|
||||||
} else if (manualContainer === Container.Top || stateContainer === Container.Top) {
|
targetContainer = (manualContainer) ? manualContainer : stateContainer;
|
||||||
topWidgets.push(widget);
|
|
||||||
} else if (isLegacyPinned && !stateContainer) {
|
} else if (isLegacyPinned && !stateContainer) {
|
||||||
topWidgets.push(widget);
|
// Special legacy case
|
||||||
} else {
|
targetContainer = Container.Top;
|
||||||
(defaultContainer === Container.Top ? topWidgets : rightWidgets).push(widget);
|
|
||||||
}
|
}
|
||||||
|
(targetContainer === Container.Top ? topWidgets : rightWidgets).push(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trim to MAX_PINNED
|
// Trim to MAX_PINNED
|
||||||
|
@ -423,7 +422,7 @@ export class WidgetLayoutStore extends ReadyWatchingStore {
|
||||||
|
|
||||||
public moveToContainer(room: Room, widget: IApp, toContainer: Container) {
|
public moveToContainer(room: Room, widget: IApp, toContainer: Container) {
|
||||||
const allWidgets = this.getAllWidgets(room);
|
const allWidgets = this.getAllWidgets(room);
|
||||||
if (!allWidgets.some(([w])=> w.id === widget.id)) return; // invalid
|
if (!allWidgets.some(([w]) => w.id === widget.id)) return; // invalid
|
||||||
this.updateUserLayout(room, {
|
this.updateUserLayout(room, {
|
||||||
[widget.id]: { container: toContainer },
|
[widget.id]: { container: toContainer },
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue