diff --git a/src/commoncomponents/js/contextmenugenerator.js b/src/commoncomponents/js/contextmenugenerator.js index 7c55365a1a80cb574988ccf8f5ac08980196d8a9..c1186e86cf37088a72ecc922c64bc1410b69a3e3 100644 --- a/src/commoncomponents/js/contextmenugenerator.js +++ b/src/commoncomponents/js/contextmenugenerator.js @@ -35,6 +35,13 @@ function createBaseContextMenuObjects(parent) { baseContextMenuComponent.errorString()) } +function initMenu() { + // Clear any existing items in the menu. + for (var i = 0; i < menuItemList.length; i++) { + baseContextMenuObject.removeItem(menuItemList[i]) + } +} + function finishCreation(parent) { baseContextMenuObject = baseContextMenuComponent.createObject(parent) if (baseContextMenuObject === null) { diff --git a/src/mainview/components/CallViewContextMenu.qml b/src/mainview/components/CallViewContextMenu.qml index 332a4dd8e0e52bb40905b976b595fbda1cfeb7d4..d477a8cbf4345efd45e0d1d51d31ded659e648a6 100644 --- a/src/mainview/components/CallViewContextMenu.qml +++ b/src/mainview/components/CallViewContextMenu.qml @@ -43,6 +43,7 @@ Item { signal transferCallButtonClicked function openMenu(){ + ContextMenuGenerator.initMenu() if (isSIP){ ContextMenuGenerator.addMenuItem(isPaused ? JamiStrings.resume : JamiStrings.hold, isPaused ? diff --git a/src/mainview/components/ConversationSmartListContextMenu.qml b/src/mainview/components/ConversationSmartListContextMenu.qml index 6b096222cb3f1b53fa23fa9a7c4658c658279d53..d6fd3700366b3cde773ea1f64ed935eaf7680921 100644 --- a/src/mainview/components/ConversationSmartListContextMenu.qml +++ b/src/mainview/components/ConversationSmartListContextMenu.qml @@ -34,6 +34,7 @@ Item { property int contactType: Profile.Type.INVALID function openMenu() { + ContextMenuGenerator.initMenu() var hasCall = UtilsAdapter.getCallId(responsibleAccountId, responsibleConvUid) !== "" if (!hasCall) { ContextMenuGenerator.addMenuItem(qsTr("Start video call"), diff --git a/src/mainview/components/ParticipantContextMenu.qml b/src/mainview/components/ParticipantContextMenu.qml index 3b0ff00325df462d3ccf76b49e380de645937b53..3bdce7164f5bc5b187cf40e08911cec0177ca76f 100644 --- a/src/mainview/components/ParticipantContextMenu.qml +++ b/src/mainview/components/ParticipantContextMenu.qml @@ -37,6 +37,7 @@ Item { property var showMinimize: false function openMenu(){ + ContextMenuGenerator.initMenu() if (showHangup) ContextMenuGenerator.addMenuItem(JamiStrings.hangup, "qrc:/images/icons/ic_call_end_white_24px.svg",