Fix right panel data flow (#7811)
This commit is contained in:
parent
78524bddce
commit
0dc1355441
14 changed files with 254 additions and 74 deletions
|
@ -40,19 +40,19 @@ const WidgetCard: React.FC<IProps> = ({ room, widgetId, onClose }) => {
|
|||
|
||||
const apps = useWidgets(room);
|
||||
const app = apps.find(a => a.id === widgetId);
|
||||
const isPinned = app && WidgetLayoutStore.instance.isInContainer(room, app, Container.Top);
|
||||
const isRight = app && WidgetLayoutStore.instance.isInContainer(room, app, Container.Right);
|
||||
|
||||
const [menuDisplayed, handle, openMenu, closeMenu] = useContextMenu();
|
||||
|
||||
useEffect(() => {
|
||||
if (!app || isPinned) {
|
||||
if (!app || !isRight) {
|
||||
// stop showing this card
|
||||
RightPanelStore.instance.popCard();
|
||||
}
|
||||
}, [app, isPinned]);
|
||||
}, [app, isRight]);
|
||||
|
||||
// Don't render anything as we are about to transition
|
||||
if (!app || isPinned) return null;
|
||||
if (!app || !isRight) return null;
|
||||
|
||||
let contextMenu;
|
||||
if (menuDisplayed) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue