Version Notifications: Support formatting
This commit is contained in:
parent
691c0c4263
commit
b874082250
@ -46,7 +46,7 @@ import {
|
|||||||
} from '../../../modules/helpers';
|
} from '../../../modules/helpers';
|
||||||
import { formatMediaDuration, formatVoiceRecordDuration, getDayStartAt } from '../../../util/dateFormat';
|
import { formatMediaDuration, formatVoiceRecordDuration, getDayStartAt } from '../../../util/dateFormat';
|
||||||
import focusEditableElement from '../../../util/focusEditableElement';
|
import focusEditableElement from '../../../util/focusEditableElement';
|
||||||
import parseMessageInput from './helpers/parseMessageInput';
|
import parseMessageInput from '../../../util/parseMessageInput';
|
||||||
import buildAttachment from './helpers/buildAttachment';
|
import buildAttachment from './helpers/buildAttachment';
|
||||||
import renderText from '../../common/helpers/renderText';
|
import renderText from '../../common/helpers/renderText';
|
||||||
import insertHtmlInSelection from '../../../util/insertHtmlInSelection';
|
import insertHtmlInSelection from '../../../util/insertHtmlInSelection';
|
||||||
|
|||||||
@ -6,7 +6,7 @@ import React, {
|
|||||||
import { ApiNewPoll } from '../../../api/types';
|
import { ApiNewPoll } from '../../../api/types';
|
||||||
|
|
||||||
import captureEscKeyListener from '../../../util/captureEscKeyListener';
|
import captureEscKeyListener from '../../../util/captureEscKeyListener';
|
||||||
import parseMessageInput from './helpers/parseMessageInput';
|
import parseMessageInput from '../../../util/parseMessageInput';
|
||||||
import useLang from '../../../hooks/useLang';
|
import useLang from '../../../hooks/useLang';
|
||||||
|
|
||||||
import Button from '../../ui/Button';
|
import Button from '../../ui/Button';
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import { ISettings } from '../../../types';
|
|||||||
import { RE_LINK_TEMPLATE } from '../../../config';
|
import { RE_LINK_TEMPLATE } from '../../../config';
|
||||||
import { selectNoWebPage, selectTheme } from '../../../modules/selectors';
|
import { selectNoWebPage, selectTheme } from '../../../modules/selectors';
|
||||||
import { pick } from '../../../util/iteratees';
|
import { pick } from '../../../util/iteratees';
|
||||||
import parseMessageInput from './helpers/parseMessageInput';
|
import parseMessageInput from '../../../util/parseMessageInput';
|
||||||
import useOnChange from '../../../hooks/useOnChange';
|
import useOnChange from '../../../hooks/useOnChange';
|
||||||
import useShowTransition from '../../../hooks/useShowTransition';
|
import useShowTransition from '../../../hooks/useShowTransition';
|
||||||
import useCurrentOrPrev from '../../../hooks/useCurrentOrPrev';
|
import useCurrentOrPrev from '../../../hooks/useCurrentOrPrev';
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { DRAFT_DEBOUNCE, EDITABLE_INPUT_ID } from '../../../../config';
|
|||||||
import usePrevious from '../../../../hooks/usePrevious';
|
import usePrevious from '../../../../hooks/usePrevious';
|
||||||
import { debounce } from '../../../../util/schedulers';
|
import { debounce } from '../../../../util/schedulers';
|
||||||
import focusEditableElement from '../../../../util/focusEditableElement';
|
import focusEditableElement from '../../../../util/focusEditableElement';
|
||||||
import parseMessageInput from '../helpers/parseMessageInput';
|
import parseMessageInput from '../../../../util/parseMessageInput';
|
||||||
import getMessageTextAsHtml from '../helpers/getMessageTextAsHtml';
|
import getMessageTextAsHtml from '../helpers/getMessageTextAsHtml';
|
||||||
import useBackgroundMode from '../../../../hooks/useBackgroundMode';
|
import useBackgroundMode from '../../../../hooks/useBackgroundMode';
|
||||||
import useBeforeUnload from '../../../../hooks/useBeforeUnload';
|
import useBeforeUnload from '../../../../hooks/useBeforeUnload';
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { ApiMessage } from '../../../../api/types';
|
|||||||
import { GlobalActions } from '../../../../global/types';
|
import { GlobalActions } from '../../../../global/types';
|
||||||
|
|
||||||
import { EDITABLE_INPUT_ID } from '../../../../config';
|
import { EDITABLE_INPUT_ID } from '../../../../config';
|
||||||
import parseMessageInput from '../helpers/parseMessageInput';
|
import parseMessageInput from '../../../../util/parseMessageInput';
|
||||||
import getMessageTextAsHtml from '../helpers/getMessageTextAsHtml';
|
import getMessageTextAsHtml from '../helpers/getMessageTextAsHtml';
|
||||||
import focusEditableElement from '../../../../util/focusEditableElement';
|
import focusEditableElement from '../../../../util/focusEditableElement';
|
||||||
import { hasMessageMedia } from '../../../../modules/helpers';
|
import { hasMessageMedia } from '../../../../modules/helpers';
|
||||||
|
|||||||
@ -38,6 +38,7 @@ import { getServerTime } from '../../../util/serverTime';
|
|||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import versionNotification from '../../../versionNotification.txt';
|
import versionNotification from '../../../versionNotification.txt';
|
||||||
|
import parseMessageInput from '../../../util/parseMessageInput';
|
||||||
|
|
||||||
const FOCUS_DURATION = 1500;
|
const FOCUS_DURATION = 1500;
|
||||||
const FOCUS_NO_HIGHLIGHT_DURATION = FAST_SMOOTH_MAX_DURATION + ANIMATION_END_DELAY;
|
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,
|
chatId: SERVICE_NOTIFICATIONS_USER_ID,
|
||||||
date: getServerTime(global.serverTimeOffset),
|
date: getServerTime(global.serverTimeOffset),
|
||||||
content: {
|
content: {
|
||||||
text: {
|
text: parseMessageInput(versionNotification),
|
||||||
text: versionNotification,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
isOutgoing: false,
|
isOutgoing: false,
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { ApiMessageEntity, ApiMessageEntityTypes, ApiFormattedText } from '../../../../api/types';
|
import { ApiMessageEntity, ApiMessageEntityTypes, ApiFormattedText } from '../api/types';
|
||||||
import { IS_EMOJI_SUPPORTED } from '../../../../util/environment';
|
import { IS_EMOJI_SUPPORTED } from './environment';
|
||||||
|
|
||||||
const ENTITY_CLASS_BY_NODE_NAME: Record<string, string> = {
|
const ENTITY_CLASS_BY_NODE_NAME: Record<string, string> = {
|
||||||
B: ApiMessageEntityTypes.Bold,
|
B: ApiMessageEntityTypes.Bold,
|
||||||
@ -1,3 +1,5 @@
|
|||||||
Welcome to dev version.
|
**Welcome to the __dev__ version.**
|
||||||
|
|
||||||
|
⛱
|
||||||
|
|
||||||
This is a demo notification.
|
This is a demo notification.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user