disable preview formattingBar disabled (#28727)
Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
45860309b1
Коммит
12f8ff0e8b
@@ -168,6 +168,7 @@ const AdvancedTextEditor = ({
|
|||||||
|
|
||||||
const readOnlyChannel = !canPost;
|
const readOnlyChannel = !canPost;
|
||||||
const hasDraftMessage = Boolean(draft.message);
|
const hasDraftMessage = Boolean(draft.message);
|
||||||
|
const showFormattingBar = !isFormattingBarHidden && !readOnlyChannel;
|
||||||
const enableSharedChannelsDMs = useSelector((state: GlobalState) => getFeatureFlagValue(state, 'EnableSharedChannelsDMs') === 'true');
|
const enableSharedChannelsDMs = useSelector((state: GlobalState) => getFeatureFlagValue(state, 'EnableSharedChannelsDMs') === 'true');
|
||||||
const isDMOrGMRemote = isChannelShared && (channelType === Constants.DM_CHANNEL || channelType === Constants.GM_CHANNEL);
|
const isDMOrGMRemote = isChannelShared && (channelType === Constants.DM_CHANNEL || channelType === Constants.GM_CHANNEL);
|
||||||
const isDisabled = Boolean(readOnlyChannel || (!enableSharedChannelsDMs && isDMOrGMRemote));
|
const isDisabled = Boolean(readOnlyChannel || (!enableSharedChannelsDMs && isDMOrGMRemote));
|
||||||
@@ -282,6 +283,7 @@ const AdvancedTextEditor = ({
|
|||||||
isValidPersistentNotifications,
|
isValidPersistentNotifications,
|
||||||
location,
|
location,
|
||||||
textboxRef,
|
textboxRef,
|
||||||
|
showFormattingBar,
|
||||||
focusTextbox,
|
focusTextbox,
|
||||||
applyMarkdown,
|
applyMarkdown,
|
||||||
handleDraftChange,
|
handleDraftChange,
|
||||||
@@ -515,8 +517,6 @@ const AdvancedTextEditor = ({
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
const showFormattingBar = !isFormattingBarHidden && !isDisabled;
|
|
||||||
|
|
||||||
const wasNotifiedOfLogIn = LocalStorageStore.getWasNotifiedOfLogIn();
|
const wasNotifiedOfLogIn = LocalStorageStore.getWasNotifiedOfLogIn();
|
||||||
|
|
||||||
let loginSuccessfulLabel;
|
let loginSuccessfulLabel;
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ const useKeyHandler = (
|
|||||||
isValidPersistentNotifications: boolean,
|
isValidPersistentNotifications: boolean,
|
||||||
location: string,
|
location: string,
|
||||||
textboxRef: React.RefObject<TextboxClass>,
|
textboxRef: React.RefObject<TextboxClass>,
|
||||||
|
showFormattingBar: boolean,
|
||||||
focusTextbox: (forceFocus?: boolean) => void,
|
focusTextbox: (forceFocus?: boolean) => void,
|
||||||
applyMarkdown: (params: ApplyMarkdownOptions) => void,
|
applyMarkdown: (params: ApplyMarkdownOptions) => void,
|
||||||
handleDraftChange: (draft: PostDraft, options?: {instant?: boolean; show?: boolean}) => void,
|
handleDraftChange: (draft: PostDraft, options?: {instant?: boolean; show?: boolean}) => void,
|
||||||
@@ -257,7 +258,7 @@ const useKeyHandler = (
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
toggleAdvanceTextEditor();
|
toggleAdvanceTextEditor();
|
||||||
} else if (Keyboard.isKeyPressed(e, KeyCodes.P) && draft.message.length && !UserAgent.isMac()) {
|
} else if (Keyboard.isKeyPressed(e, KeyCodes.P) && draft.message.length && !UserAgent.isMac() && showFormattingBar) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
toggleShowPreview();
|
toggleShowPreview();
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user