diff --git a/packages/client/src/store/ContextOptionsStore.js b/packages/client/src/store/ContextOptionsStore.js index 4ae80507a1..5f848404b1 100644 --- a/packages/client/src/store/ContextOptionsStore.js +++ b/packages/client/src/store/ContextOptionsStore.js @@ -1066,71 +1066,10 @@ class ContextOptionsStore { !contextOptions.includes("finalize-version") && contextOptions.includes("show-version-history"); - const versionActions = isDesktop() - ? onlyShowVersionHistory - ? [ - { - id: "option_show-version-history", - key: "show-version-history", - label: t("ShowVersionHistory"), - icon: HistoryReactSvgUrl, - onClick: () => - this.showVersionHistory( - item.id, - item.security, - item?.requestToken, - ), - disabled: false, - }, - ] - : [ - { - id: "option_version", - key: "version", - label: t("VersionHistory"), - icon: HistoryFinalizedReactSvgUrl, - items: [ - { - id: "option_finalize-version", - key: "finalize-version", - label: t("FinalizeVersion"), - icon: HistoryFinalizedReactSvgUrl, - onClick: () => - isEditing - ? this.onShowEditingToast(t) - : this.finalizeVersion(item.id, item.security), - disabled: false, - }, - { - id: "option_version-history", - key: "show-version-history", - label: t("ShowVersionHistory"), - icon: HistoryReactSvgUrl, - onClick: () => - this.showVersionHistory( - item.id, - item.security, - item?.requestToken, - ), - disabled: false, - }, - ], - }, - ] - : [ + const versionActions = onlyShowVersionHistory + ? [ { - id: "option_finalize-version", - key: "finalize-version", - label: t("FinalizeVersion"), - icon: HistoryFinalizedReactSvgUrl, - onClick: () => - isEditing - ? this.onShowEditingToast(t) - : this.finalizeVersion(item.id), - disabled: false, - }, - { - id: "option_version-history", + id: "option_show-version-history", key: "show-version-history", label: t("ShowVersionHistory"), icon: HistoryReactSvgUrl, @@ -1142,73 +1081,107 @@ class ContextOptionsStore { ), disabled: false, }, + ] + : [ + { + id: "option_version", + key: "version", + label: t("VersionHistory"), + icon: HistoryFinalizedReactSvgUrl, + items: [ + { + id: "option_finalize-version", + key: "finalize-version", + label: t("FinalizeVersion"), + icon: HistoryFinalizedReactSvgUrl, + onClick: () => + isEditing + ? this.onShowEditingToast(t) + : this.finalizeVersion(item.id, item.security), + disabled: false, + }, + { + id: "option_version-history", + key: "show-version-history", + label: t("ShowVersionHistory"), + icon: HistoryReactSvgUrl, + onClick: () => + this.showVersionHistory( + item.id, + item.security, + item?.requestToken, + ), + disabled: false, + }, + ], + }, + ]; + + const moveActions = !isInfoPanel + ? [ + { + id: "option_move-or-copy", + key: "move", + label: t("MoveOrCopy"), + icon: CopyReactSvgUrl, + items: [ + { + id: "option_move-to", + key: "move-to", + label: t("Common:MoveTo"), + icon: MoveReactSvgUrl, + onClick: isEditing + ? () => this.onShowEditingToast(t) + : this.onMoveAction, + disabled: false, + }, + { + id: "option_copy-to", + key: "copy-to", + label: t("Common:Copy"), + icon: CopyReactSvgUrl, + onClick: this.onCopyAction, + disabled: false, + }, + { + id: "option_create-copy", + key: "copy", + label: t("Common:Duplicate"), + icon: DuplicateReactSvgUrl, + onClick: () => this.onDuplicate(item, t), + disabled: false, + }, + ], + }, + ] + : [ + { + id: "option_move-to", + key: "move-to", + label: t("Common:MoveTo"), + icon: MoveReactSvgUrl, + onClick: isEditing + ? () => this.onShowEditingToast(t) + : this.onMoveAction, + disabled: false, + }, + { + id: "option_copy-to", + key: "copy-to", + label: t("Common:Copy"), + icon: CopyReactSvgUrl, + onClick: this.onCopyAction, + disabled: false, + }, + { + id: "option_create-copy", + key: "copy", + label: t("Common:Duplicate"), + icon: DuplicateReactSvgUrl, + onClick: () => this.onDuplicate(item, t), + disabled: false, + }, ]; - const moveActions = - isDesktop() && !isInfoPanel - ? [ - { - id: "option_move-or-copy", - key: "move", - label: t("MoveOrCopy"), - icon: CopyReactSvgUrl, - items: [ - { - id: "option_move-to", - key: "move-to", - label: t("Common:MoveTo"), - icon: MoveReactSvgUrl, - onClick: isEditing - ? () => this.onShowEditingToast(t) - : this.onMoveAction, - disabled: false, - }, - { - id: "option_copy-to", - key: "copy-to", - label: t("Common:Copy"), - icon: CopyReactSvgUrl, - onClick: this.onCopyAction, - disabled: false, - }, - { - id: "option_create-copy", - key: "copy", - label: t("Common:Duplicate"), - icon: DuplicateReactSvgUrl, - onClick: () => this.onDuplicate(item, t), - disabled: false, - }, - ], - }, - ] - : [ - { - id: "option_move-to", - key: "move-to", - label: t("Common:MoveTo"), - icon: MoveReactSvgUrl, - onClick: isEditing - ? () => this.onShowEditingToast(t) - : this.onMoveAction, - disabled: false, - }, - { - id: "option_copy-to", - key: "copy-to", - label: t("Common:Copy"), - icon: CopyReactSvgUrl, - onClick: this.onCopyAction, - disabled: false, - }, - { - id: "option_create-copy", - key: "copy", - label: t("Common:Duplicate"), - icon: DuplicateReactSvgUrl, - onClick: () => this.onDuplicate(item, t), - disabled: false, - }, - ]; const { pinOptions, muteOptions } = this.getRoomsRootContextOptions( item, @@ -1605,7 +1578,7 @@ class ContextOptionsStore { const pluginItems = this.onLoadPlugins(item); if (pluginItems.length > 0) { - if (!isDesktop() || pluginItems.length === 1) { + if (pluginItems.length === 1) { pluginItems.forEach((plugin) => { options.splice(1, 0, { id: `option_${plugin.key}`,