This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -82,8 +82,11 @@ const WidgetContextMenu: React.FC<IProps> = ({
8282 /> ;
8383 }
8484
85+ const pinnedWidgets = WidgetLayoutStore . instance . getContainerWidgets ( room , Container . Top ) ;
86+ const widgetIndex = pinnedWidgets . findIndex ( widget => widget . id === app . id ) ;
87+
8588 let unpinButton ;
86- if ( showUnpin ) {
89+ if ( showUnpin && widgetIndex >= 0 ) {
8790 const onUnpinClick = ( ) => {
8891 WidgetLayoutStore . instance . moveToContainer ( room , app , Container . Right ) ;
8992 onFinished ( ) ;
@@ -175,9 +178,6 @@ const WidgetContextMenu: React.FC<IProps> = ({
175178 revokeButton = < IconizedContextMenuOption onClick = { onRevokeClick } label = { _t ( "Revoke permissions" ) } /> ;
176179 }
177180
178- const pinnedWidgets = WidgetLayoutStore . instance . getContainerWidgets ( room , Container . Top ) ;
179- const widgetIndex = pinnedWidgets . findIndex ( widget => widget . id === app . id ) ;
180-
181181 let moveLeftButton ;
182182 if ( showUnpin && widgetIndex > 0 ) {
183183 const onClick = ( ) => {
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ import PersistedElement, { getPersistKey } from "./PersistedElement";
3939import { WidgetType } from "../../../widgets/WidgetType" ;
4040import { StopGapWidget } from "../../../stores/widgets/StopGapWidget" ;
4141import { ElementWidgetActions } from "../../../stores/widgets/ElementWidgetActions" ;
42- import RoomWidgetContextMenu from "../context_menus/WidgetContextMenu" ;
42+ import WidgetContextMenu from "../context_menus/WidgetContextMenu" ;
4343import WidgetAvatar from "../avatars/WidgetAvatar" ;
4444import { replaceableComponent } from "../../../utils/replaceableComponent" ;
4545import CallHandler from '../../../CallHandler' ;
@@ -573,7 +573,7 @@ export default class AppTile extends React.Component<IProps, IState> {
573573 let contextMenu ;
574574 if ( this . state . menuDisplayed ) {
575575 contextMenu = (
576- < RoomWidgetContextMenu
576+ < WidgetContextMenu
577577 { ...aboveLeftOf ( this . contextMenuButton . current . getBoundingClientRect ( ) , null ) }
578578 app = { this . props . app }
579579 onFinished = { this . closeContextMenu }
You can’t perform that action at this time.
0 commit comments