Version Notifications: Support formatting

This commit is contained in:
Alexander Zinchuk 2021-10-22 13:49:24 +03:00
parent 691c0c4263
commit b874082250
8 changed files with 12 additions and 11 deletions

View File

@ -46,7 +46,7 @@ import {
} from '../../../modules/helpers';
import { formatMediaDuration, formatVoiceRecordDuration, getDayStartAt } from '../../../util/dateFormat';
import focusEditableElement from '../../../util/focusEditableElement';
import parseMessageInput from './helpers/parseMessageInput';
import parseMessageInput from '../../../util/parseMessageInput';
import buildAttachment from './helpers/buildAttachment';
import renderText from '../../common/helpers/renderText';
import insertHtmlInSelection from '../../../util/insertHtmlInSelection';

View File

@ -6,7 +6,7 @@ import React, {
import { ApiNewPoll } from '../../../api/types';
import captureEscKeyListener from '../../../util/captureEscKeyListener';
import parseMessageInput from './helpers/parseMessageInput';
import parseMessageInput from '../../../util/parseMessageInput';
import useLang from '../../../hooks/useLang';
import Button from '../../ui/Button';

View File

@ -10,7 +10,7 @@ import { ISettings } from '../../../types';
import { RE_LINK_TEMPLATE } from '../../../config';
import { selectNoWebPage, selectTheme } from '../../../modules/selectors';
import { pick } from '../../../util/iteratees';
import parseMessageInput from './helpers/parseMessageInput';
import parseMessageInput from '../../../util/parseMessageInput';
import useOnChange from '../../../hooks/useOnChange';
import useShowTransition from '../../../hooks/useShowTransition';
import useCurrentOrPrev from '../../../hooks/useCurrentOrPrev';

View File

@ -7,7 +7,7 @@ import { DRAFT_DEBOUNCE, EDITABLE_INPUT_ID } from '../../../../config';
import usePrevious from '../../../../hooks/usePrevious';
import { debounce } from '../../../../util/schedulers';
import focusEditableElement from '../../../../util/focusEditableElement';
import parseMessageInput from '../helpers/parseMessageInput';
import parseMessageInput from '../../../../util/parseMessageInput';
import getMessageTextAsHtml from '../helpers/getMessageTextAsHtml';
import useBackgroundMode from '../../../../hooks/useBackgroundMode';
import useBeforeUnload from '../../../../hooks/useBeforeUnload';

View File

@ -4,7 +4,7 @@ import { ApiMessage } from '../../../../api/types';
import { GlobalActions } from '../../../../global/types';
import { EDITABLE_INPUT_ID } from '../../../../config';
import parseMessageInput from '../helpers/parseMessageInput';
import parseMessageInput from '../../../../util/parseMessageInput';
import getMessageTextAsHtml from '../helpers/getMessageTextAsHtml';
import focusEditableElement from '../../../../util/focusEditableElement';
import { hasMessageMedia } from '../../../../modules/helpers';

View File

@ -38,6 +38,7 @@ import { getServerTime } from '../../../util/serverTime';
// @ts-ignore
import versionNotification from '../../../versionNotification.txt';
import parseMessageInput from '../../../util/parseMessageInput';
const FOCUS_DURATION = 1500;
const FOCUS_NO_HIGHLIGHT_DURATION = FAST_SMOOTH_MAX_DURATION + ANIMATION_END_DELAY;
@ -529,9 +530,7 @@ addReducer('checkVersionNotification', (global, actions) => {
chatId: SERVICE_NOTIFICATIONS_USER_ID,
date: getServerTime(global.serverTimeOffset),
content: {
text: {
text: versionNotification,
},
text: parseMessageInput(versionNotification),
},
isOutgoing: false,
};

View File

@ -1,5 +1,5 @@
import { ApiMessageEntity, ApiMessageEntityTypes, ApiFormattedText } from '../../../../api/types';
import { IS_EMOJI_SUPPORTED } from '../../../../util/environment';
import { ApiMessageEntity, ApiMessageEntityTypes, ApiFormattedText } from '../api/types';
import { IS_EMOJI_SUPPORTED } from './environment';
const ENTITY_CLASS_BY_NODE_NAME: Record<string, string> = {
B: ApiMessageEntityTypes.Bold,

View File

@ -1,3 +1,5 @@
Welcome to dev version.
**Welcome to the __dev__ version.**
This is a demo notification.