mirror of
https://github.com/outline/outline.git
synced 2026-12-04 02:20:17 +03:00
fix: Only show editing stats toggle when viewing a document (#13530)
* fix: Only show editing stats toggle when viewing a document Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> * Default isViewing to false Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
e22b423fc3
commit
c8bfd8488d
2 files changed
+14
-2
No files matched your search
@@ -45,6 +45,8 @@ import { useTemplateMenuActions } from "./useTemplateMenuActions";
|
||||
type Props = {
|
||||
/** Document ID for which the actions are generated */
|
||||
documentId: string;
|
||||
/** Whether the document is currently being viewed */
|
||||
isViewing?: boolean;
|
||||
/** Invoked when the "Find and replace" menu item is clicked */
|
||||
onFindAndReplace?: () => void;
|
||||
/** Invoked when the "Rename" menu item is clicked */
|
||||
@@ -55,6 +57,7 @@ type Props = {
|
||||
|
||||
export function useDocumentMenuAction({
|
||||
documentId,
|
||||
isViewing = false,
|
||||
onFindAndReplace,
|
||||
onRename,
|
||||
onSelectTemplate,
|
||||
@@ -106,7 +109,7 @@ export function useDocumentMenuAction({
|
||||
openDocumentComments,
|
||||
openDocumentHistory,
|
||||
openDocumentInsights,
|
||||
toggleDocumentStats,
|
||||
...(isViewing ? [toggleDocumentStats] : []),
|
||||
openDocumentInSplit,
|
||||
openDocumentInDesktop,
|
||||
presentDocument,
|
||||
@@ -118,6 +121,14 @@ export function useDocumentMenuAction({
|
||||
permanentlyDeleteDocument,
|
||||
leaveDocument,
|
||||
]),
|
||||
[t, isMobile, templateMenuActions, documentId, onFindAndReplace, onRename]
|
||||
[
|
||||
t,
|
||||
isMobile,
|
||||
isViewing,
|
||||
templateMenuActions,
|
||||
documentId,
|
||||
onFindAndReplace,
|
||||
onRename,
|
||||
]
|
||||
);
|
||||
}
|
||||
@@ -129,6 +129,7 @@ function DocumentMenu({
|
||||
|
||||
const rootAction = useDocumentMenuAction({
|
||||
documentId: document.id,
|
||||
isViewing: showDisplayOptions,
|
||||
onFindAndReplace,
|
||||
onRename,
|
||||
onSelectTemplate,
|
||||
|
||||
Reference in new issue
Block a user