From 6a47b10ade964e174f401a3c9a2df7eedf89dd6d Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Tue, 24 Aug 2021 19:33:04 +0300 Subject: [PATCH] fixes --- src/components/chat/bubbles.ts | 4 +- src/components/chat/input.ts | 16 ++- .../dom/fixSafariStickyInputFocusing.ts | 112 ++++++++++++++++++ src/index.ts | 83 +------------ src/lib/appManagers/apiUpdatesManager.ts | 10 +- src/lib/appManagers/appDialogsManager.ts | 37 +++--- src/lib/appManagers/appImManager.ts | 3 +- src/lib/appManagers/appMessagesManager.ts | 57 ++++++--- src/lib/rootScope.ts | 2 +- src/scss/partials/_chat.scss | 12 +- src/scss/partials/_leftSidebar.scss | 8 +- 11 files changed, 211 insertions(+), 133 deletions(-) create mode 100644 src/helpers/dom/fixSafariStickyInputFocusing.ts diff --git a/src/components/chat/bubbles.ts b/src/components/chat/bubbles.ts index b964e0b0..423a0e87 100644 --- a/src/components/chat/bubbles.ts +++ b/src/components/chat/bubbles.ts @@ -525,10 +525,8 @@ export default class ChatBubbles { this.listenerSetter.add(rootScope)('history_delete', (e) => { const {peerId, msgs} = e; - const mids = Object.keys(msgs).map(s => +s); - if(peerId === this.peerId) { - this.deleteMessagesByIds(mids); + this.deleteMessagesByIds(Array.from(msgs)); } }); diff --git a/src/components/chat/input.ts b/src/components/chat/input.ts index d8193c3a..c62d3ff2 100644 --- a/src/components/chat/input.ts +++ b/src/components/chat/input.ts @@ -73,10 +73,10 @@ import debounce from '../../helpers/schedulers/debounce'; import noop from '../../helpers/noop'; import { putPreloader } from '../misc'; import SetTransition from '../singleTransition'; -import replaceContent from '../../helpers/dom/replaceContent'; import PeerTitle from '../peerTitle'; import { fastRaf } from '../../helpers/schedulers'; import PopupDeleteMessages from '../popups/deleteMessages'; +import fixSafariStickyInputFocusing, { IS_STICKY_INPUT_BUGGED } from '../../helpers/dom/fixSafariStickyInputFocusing'; const RECORD_MIN_TIME = 500; const POSTING_MEDIA_NOT_ALLOWED = 'Posting media content isn\'t allowed in this group.'; @@ -495,11 +495,11 @@ export default class ChatInput { } else { this.listenerSetter.add(rootScope)('history_delete', ({peerId, msgs}) => { if(this.chat.peerId === peerId) { - if(msgs[this.editMsgId]) { + if(msgs.has(this.editMsgId)) { this.onMessageSent(); } - if(this.replyToMsgId && msgs[this.replyToMsgId]) { + if(this.replyToMsgId && msgs.has(this.replyToMsgId)) { this.clearHelper('reply'); } } @@ -835,6 +835,10 @@ export default class ChatInput { this.messageInput = this.messageInputField.input; this.messageInput.classList.add('no-scrollbar'); this.attachMessageInputListeners(); + + if(IS_STICKY_INPUT_BUGGED) { + fixSafariStickyInputFocusing(this.messageInput); + } if(oldInputField) { oldInputField.input.replaceWith(this.messageInputField.input); @@ -1061,7 +1065,7 @@ export default class ChatInput { if(good) { // * костыльчик - if(key === 'K') { + if(key === 'K' && this.appImManager.markupTooltip) { this.appImManager.markupTooltip.showLinkEditor(); cancelEvent(e); break; @@ -1185,7 +1189,9 @@ export default class ChatInput { this.appMessagesManager.setTyping(this.chat.peerId, {_: 'sendMessageCancelAction'}); } - this.appImManager.markupTooltip.hide(); + if(this.appImManager.markupTooltip) { + this.appImManager.markupTooltip.hide(); + } } else { const time = Date.now(); if(time - this.lastTimeType >= 6000) { diff --git a/src/helpers/dom/fixSafariStickyInputFocusing.ts b/src/helpers/dom/fixSafariStickyInputFocusing.ts new file mode 100644 index 00000000..d863aa57 --- /dev/null +++ b/src/helpers/dom/fixSafariStickyInputFocusing.ts @@ -0,0 +1,112 @@ +/* + * https://github.com/morethanwords/tweb + * Copyright (C) 2019-2021 Eduard Kuzmenko + * https://github.com/morethanwords/tweb/blob/master/LICENSE + */ + +import { isTouchSupported } from "../touchSupport"; +import { isMobile, isSafari } from "../userAgent"; +import findUpClassName from "./findUpClassName"; +import fixSafariStickyInput from "./fixSafariStickyInput"; + +export const IS_STICKY_INPUT_BUGGED = isSafari && isMobile && isTouchSupported; + +if(IS_STICKY_INPUT_BUGGED) { + let key: 'clientY' | 'pageY' = 'clientY'; + let startY = 0; + const o = {capture: true, passive: false}; + const onTouchMove = (e: TouchEvent) => { + const touch = e.touches[0]; + + //console.log('touchmove y', touch[key], startY); + + const scrollable = findUpClassName(touch.target, 'scrollable-y'); + if(scrollable) { + const y = touch[key]; + const scrolled = startY - y; + + /* if(y < startY) { + startY = y; + } */ + + const scrollTop = scrollable.scrollTop; + const scrollHeight = scrollable.scrollHeight; + const clientHeight = scrollable.clientHeight; + const nextScrollTop = scrollTop ? Math.round(scrollTop + scrollable.clientHeight + scrolled) : scrollTop + scrolled; + //const needCancel = scrollHeight !== clientHeight ? (scrollTop && diff <= 1) || (scrollTop - diff) < 0 : true; + const needCancel = scrollHeight === clientHeight || nextScrollTop >= scrollHeight || nextScrollTop <= 0; + if(needCancel) { + e.preventDefault(); + } + + //console.log('touchmove with scrollable', scrollTop, startY, scrolled, nextScrollTop, needCancel, e.cancelable); + } else { + e.preventDefault(); + + //console.log('touchmove no scrollable', e, touch); + } + + //if(e.target === document.documentElement || e.target === document.body) e.preventDefault(); + }; + + // let el = document.createElement('div'); + // document.body.prepend(el); + // let a = 0; + + // let hasFocus = false; + let lastFocusOutTimeStamp = 0; + document.addEventListener('focusin', (e) => { + if((e.timeStamp - lastFocusOutTimeStamp) < 50/* && document.activeElement === input */) { + return; + } + + // console.log('focusin', e, e.timeStamp); + + // hasFocus = true; + // document.body.classList.add('is-keyboard-opened'); + + // el.innerText = 'focusin ' + ++a; + + /* a < 2 && */fixSafariStickyInput(e.target as HTMLElement); + + document.addEventListener('touchmove', onTouchMove, o); + document.addEventListener('touchstart', (e) => { + if(e.touches.length > 1) return; + const touchStart = e.touches[0]; + + startY = touchStart[key]; + }); + }, {passive: true}); + + document.addEventListener('focusout', (e) => { + // console.log('focusout', e, e.timeStamp); + document.removeEventListener('touchmove', onTouchMove, o); + + lastFocusOutTimeStamp = e.timeStamp; + + // el.innerText = 'focusout ' + ++a; + + // if(hasFocus) { + // hasFocus = false; + // document.body.classList.remove('is-keyboard-opened'); + // } + }, {passive: true}); + + document.addEventListener('visibilitychange', () => { + // console.log('window visibilitychange'); + if(document.activeElement && + document.activeElement.classList.contains('is-sticky-input-bugged') && + (document.activeElement as HTMLElement).blur) { + fixSafariStickyInput(document.activeElement as HTMLElement); + } + + /* blurActiveElement(); + window.scrollTo(0, 0); + setVH(); */ + }, {passive: true}); +} + +export default function fixSafariStickyInputFocusing(input: HTMLElement) { + if(!IS_STICKY_INPUT_BUGGED) return; + input.classList.add('is-sticky-input-bugged'); +} diff --git a/src/index.ts b/src/index.ts index 3c4986b6..babfe88b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,8 +7,8 @@ import App from './config/app'; import blurActiveElement from './helpers/dom/blurActiveElement'; import { cancelEvent } from './helpers/dom/cancelEvent'; -import findUpClassName from './helpers/dom/findUpClassName'; import fixSafariStickyInput from './helpers/dom/fixSafariStickyInput'; +import { IS_STICKY_INPUT_BUGGED } from './helpers/dom/fixSafariStickyInputFocusing'; import loadFonts from './helpers/dom/loadFonts'; import IS_EMOJI_SUPPORTED from './helpers/emojiSupport'; import { isMobileSafari } from './helpers/userAgent'; @@ -116,7 +116,7 @@ console.timeEnd('get storage1'); */ //console.log(new Uint8Array([255, 200, 145]).hex); const toggleResizeMode = () => { - setViewportVH = tabId === 1 && userAgent.isSafari && touchSupport.isTouchSupported && !rootScope.default.isOverlayActive; + setViewportVH = tabId === 1 && IS_STICKY_INPUT_BUGGED && !rootScope.default.isOverlayActive; setVH(); if(w !== window) { @@ -165,85 +165,6 @@ console.timeEnd('get storage1'); */ if(userAgent.isApple) { if(userAgent.isSafari) { document.documentElement.classList.add('is-safari'); - - if(userAgent.isMobile && touchSupport.isTouchSupported) { - let key: 'clientY' | 'pageY' = 'clientY'; - let startY = 0; - const o = {capture: true, passive: false}; - const onTouchMove = (e: TouchEvent) => { - const touch = e.touches[0]; - - //console.log('touchmove y', touch[key], startY); - - const scrollable = findUpClassName(touch.target, 'scrollable-y'); - if(scrollable) { - const y = touch[key]; - const scrolled = startY - y; - - /* if(y < startY) { - startY = y; - } */ - - const scrollTop = scrollable.scrollTop; - const scrollHeight = scrollable.scrollHeight; - const clientHeight = scrollable.clientHeight; - const nextScrollTop = scrollTop ? Math.round(scrollTop + scrollable.clientHeight + scrolled) : scrollTop + scrolled; - //const needCancel = scrollHeight !== clientHeight ? (scrollTop && diff <= 1) || (scrollTop - diff) < 0 : true; - const needCancel = scrollHeight === clientHeight || nextScrollTop >= scrollHeight || nextScrollTop <= 0; - if(needCancel) { - e.preventDefault(); - } - - //console.log('touchmove with scrollable', scrollTop, startY, scrolled, nextScrollTop, needCancel, e.cancelable); - } else { - e.preventDefault(); - - //console.log('touchmove no scrollable', e, touch); - } - - //if(e.target === document.documentElement || e.target === document.body) e.preventDefault(); - }; - - // let isOpened = false; - document.addEventListener('focusin', (e) => { - if(!setViewportVH) return; - //console.log('focusin'); - - // isOpened = true; - // document.body.classList.add('is-keyboard-opened'); - - fixSafariStickyInput(e.target as HTMLElement); - - document.addEventListener('touchmove', onTouchMove, o); - document.addEventListener('touchstart', (e) => { - if(e.touches.length > 1) return; - const touchStart = e.touches[0]; - - startY = touchStart[key]; - }); - }); - - document.addEventListener('focusout', () => { - document.removeEventListener('touchmove', onTouchMove, o); - - // if(isOpened) { - // isOpened = false; - // document.body.classList.remove('is-keyboard-opened'); - // } - }); - - document.addEventListener('visibilitychange', () => { - if(!setViewportVH) return; - //console.log('window visibilitychange'); - if(document.activeElement && (document.activeElement as HTMLElement).blur) { - fixSafariStickyInput(document.activeElement as HTMLElement); - } - - /* blurActiveElement(); - window.scrollTo(0, 0); - setVH(); */ - }); - } } document.documentElement.classList.add('is-mac', 'emoji-supported'); diff --git a/src/lib/appManagers/apiUpdatesManager.ts b/src/lib/appManagers/apiUpdatesManager.ts index 64694436..491561be 100644 --- a/src/lib/appManagers/apiUpdatesManager.ts +++ b/src/lib/appManagers/apiUpdatesManager.ts @@ -21,6 +21,7 @@ import appChatsManager from "./appChatsManager"; import appPeersManager from "./appPeersManager"; import appStateManager from './appStateManager'; import serverTimeManager from '../mtproto/serverTimeManager'; +import assumeType from '../../helpers/assumeType'; type UpdatesState = { pendingPtsUpdates: (Update & {pts: number, pts_count: number})[], @@ -197,12 +198,13 @@ export class ApiUpdatesManager { case 'updateShortMessage': case 'updateShortChatMessage': { + assumeType(updateMessage); this.debug && this.log.debug('updateShortMessage | updateShortChatMessage', {...updateMessage}); const isOut = updateMessage.pFlags.out; - const fromId = updateMessage.from_id || (isOut ? rootScope.myId : updateMessage.user_id); - const toId = updateMessage.chat_id - ? -updateMessage.chat_id - : (updateMessage.user_id || rootScope.myId); + const fromId = (updateMessage as Updates.updateShortChatMessage).from_id || (isOut ? rootScope.myId : (updateMessage as Updates.updateShortMessage).user_id); + const toId = (updateMessage as Updates.updateShortChatMessage).chat_id + ? -(updateMessage as Updates.updateShortChatMessage).chat_id + : ((updateMessage as Updates.updateShortMessage).user_id || rootScope.myId); this.processUpdate({ _: 'updateNewMessage', diff --git a/src/lib/appManagers/appDialogsManager.ts b/src/lib/appManagers/appDialogsManager.ts index 803622b4..b9acf4c6 100644 --- a/src/lib/appManagers/appDialogsManager.ts +++ b/src/lib/appManagers/appDialogsManager.ts @@ -1240,29 +1240,29 @@ export class AppDialogsManager { return; } - let peer = dialog.peer; - let peerId = dialog.peerId; + const peer = dialog.peer; + const peerId = dialog.peerId; //let peerId = appMessagesManager.getMessagePeer(lastMessage); //console.log('setting last message:', lastMessage); /* if(!dom.lastMessageSpan.classList.contains('user-typing')) */ { - dom.lastMessageSpan.textContent = ''; + let fragment: DocumentFragment; if(highlightWord && lastMessage.message) { - dom.lastMessageSpan.append(appMessagesManager.wrapMessageForReply(lastMessage, undefined, undefined, false, highlightWord)); + fragment = appMessagesManager.wrapMessageForReply(lastMessage, undefined, undefined, false, highlightWord); } else if(draftMessage) { - dom.lastMessageSpan.append(appMessagesManager.wrapMessageForReply(draftMessage)); + fragment = appMessagesManager.wrapMessageForReply(draftMessage); } else if(!lastMessage.deleted) { - dom.lastMessageSpan.append(appMessagesManager.wrapMessageForReply(lastMessage)); + fragment = appMessagesManager.wrapMessageForReply(lastMessage); } + replaceContent(dom.lastMessageSpan, fragment); /* if(lastMessage.from_id === auth.id) { // You: */ if(draftMessage) { const bold = document.createElement('b'); bold.classList.add('danger'); - bold.append(i18n('Draft')); - bold.append(': '); + bold.append(i18n('Draft'), ': '); dom.lastMessageSpan.prepend(bold); } else if(peer._ !== 'peerUser' && peerId !== lastMessage.fromId && !lastMessage.action) { const sender = appPeersManager.getPeer(lastMessage.fromId); @@ -1288,8 +1288,7 @@ export class AppDialogsManager { if(!lastMessage.deleted || draftMessage/* && lastMessage._ !== 'draftMessage' */) { const date = draftMessage ? Math.max(draftMessage.date, lastMessage.date || 0) : lastMessage.date; - dom.lastTimeSpan.textContent = ''; - dom.lastTimeSpan.append(formatDateAccordingToTodayNew(new Date(date * 1000))); + replaceContent(dom.lastTimeSpan, formatDateAccordingToTodayNew(new Date(date * 1000))); } else dom.lastTimeSpan.textContent = ''; if(this.doms[peerId] === dom) { @@ -1317,18 +1316,15 @@ export class AppDialogsManager { SetTransition(dom.listEl, 'is-muted', isMuted, 200); } - const lastMessage = dialog.draft && dialog.draft._ === 'draftMessage' ? + const lastMessage = dialog.draft?._ === 'draftMessage' ? dialog.draft : appMessagesManager.getMessageByPeer(dialog.peerId, dialog.top_message); - if(lastMessage._ !== 'messageEmpty' && !lastMessage.deleted && - lastMessage.pFlags.out && lastMessage.peerId !== rootScope.myId/* && + if(!lastMessage.deleted && lastMessage.pFlags.out && lastMessage.peerId !== rootScope.myId/* && dialog.read_outbox_max_id */) { // maybe comment, 06.20.2020 - const outgoing = (lastMessage.pFlags && lastMessage.pFlags.unread) + const isUnread = (lastMessage.pFlags && lastMessage.pFlags.unread) /* && dialog.read_outbox_max_id !== 0 */; // maybe uncomment, 31.01.2020 - - //console.log('outgoing', outgoing, lastMessage); - - if(outgoing) { + + if(isUnread) { dom.statusSpan.classList.remove('tgico-checks'); dom.statusSpan.classList.add('tgico-check'); } else { @@ -1337,12 +1333,10 @@ export class AppDialogsManager { } } else dom.statusSpan.classList.remove('tgico-check', 'tgico-checks'); - dom.unreadMessagesSpan.innerText = ''; - const filter = appMessagesManager.filtersStorage.filters[this.filterId]; let isPinned: boolean; if(filter) { - isPinned = filter.pinned_peers.findIndex(peerId => peerId === dialog.peerId) !== -1; + isPinned = filter.pinned_peers.indexOf(dialog.peerId) !== -1; } else { isPinned = !!dialog.pFlags.pinned; } @@ -1358,6 +1352,7 @@ export class AppDialogsManager { dom.unreadMessagesSpan.innerText = '' + (dialog.unread_count || ' '); dom.unreadMessagesSpan.classList.add('unread'); } else { + dom.unreadMessagesSpan.innerText = ''; dom.unreadMessagesSpan.classList.remove('unread'); } } diff --git a/src/lib/appManagers/appImManager.ts b/src/lib/appManagers/appImManager.ts index 726c92ec..18b6efd8 100644 --- a/src/lib/appManagers/appImManager.ts +++ b/src/lib/appManagers/appImManager.ts @@ -865,8 +865,7 @@ export class AppImManager { rootScope.addEventListener('history_delete', (e) => { const {peerId, msgs} = e; - const mids = Object.keys(msgs).map(s => +s); - appSidebarRight.sharedMediaTab.deleteDeletedMessages(peerId, mids); + appSidebarRight.sharedMediaTab.deleteDeletedMessages(peerId, Array.from(msgs)); }); // Calls when message successfully sent and we have an id diff --git a/src/lib/appManagers/appMessagesManager.ts b/src/lib/appManagers/appMessagesManager.ts index 8e189c72..6f86df8b 100644 --- a/src/lib/appManagers/appMessagesManager.ts +++ b/src/lib/appManagers/appMessagesManager.ts @@ -3946,10 +3946,15 @@ export class AppMessagesManager { const inboxUnread = !message.pFlags.out && message.pFlags.unread; if(dialog) { - this.setDialogTopMessage(message, dialog); if(inboxUnread) { - dialog.unread_count++; + ++dialog.unread_count; + + if(message.pFlags.mentioned) { + ++dialog.unread_mentions_count; + } } + + this.setDialogTopMessage(message, dialog); } if(inboxUnread/* && ($rootScope.selectedPeerID != peerID || $rootScope.idle.isIDLE) */) { @@ -4052,6 +4057,7 @@ export class AppMessagesManager { const foundDialog = this.getDialogOnly(peerId); const stillUnreadCount = (update as Update.updateReadChannelInbox).still_unread_count; let newUnreadCount = 0; + let newUnreadMentionsCount = 0; let foundAffected = false; //this.log.warn(dT(), 'read', peerId, isOut ? 'out' : 'in', maxId) @@ -4076,7 +4082,7 @@ export class AppMessagesManager { continue; } - const message = storage[messageId]; + const message: MyMessage = storage[messageId]; if(message.pFlags.out !== isOut) { continue; @@ -4087,7 +4093,7 @@ export class AppMessagesManager { } if(threadId) { - const replyTo = message.reply_to as MessageReplyHeader; + const replyTo = message.reply_to; if(!replyTo || (replyTo.reply_to_top_id || replyTo.reply_to_msg_id) !== threadId) { continue; } @@ -4100,8 +4106,14 @@ export class AppMessagesManager { foundAffected = true; } - if(!message.pFlags.out && !threadId && foundDialog && stillUnreadCount === undefined) { - newUnreadCount = --foundDialog.unread_count; + if(!message.pFlags.out && !threadId && foundDialog) { + if(stillUnreadCount === undefined) { + newUnreadCount = --foundDialog.unread_count; + } + + if(message.pFlags.mentioned) { + newUnreadMentionsCount = --foundDialog.unread_mentions_count; + } } appNotificationsManager.cancel('msg' + messageId); @@ -4116,7 +4128,9 @@ export class AppMessagesManager { else foundDialog.read_inbox_max_id = maxId; if(!isOut) { - if(newUnreadCount < 0 || !this.getReadMaxIdIfUnread(peerId)) { + if(stillUnreadCount !== undefined) { + foundDialog.unread_count = stillUnreadCount; + } else if(newUnreadCount < 0 || !this.getReadMaxIdIfUnread(peerId)) { foundDialog.unread_count = 0; } else if(newUnreadCount && foundDialog.top_message > maxId) { foundDialog.unread_count = newUnreadCount; @@ -4147,7 +4161,7 @@ export class AppMessagesManager { const mids = (update as Update.updateReadMessagesContents).messages.map(id => appMessagesIdsManager.generateMessageId(id)); const peerId = channelId ? -channelId : this.getMessageById(mids[0]).peerId; for(const mid of mids) { - const message = this.getMessageByPeer(peerId, mid); + const message: MyMessage = this.getMessageByPeer(peerId, mid); if(!message.deleted) { delete message.pFlags.media_unread; this.setDialogToStateIfMessageIsTop(message); @@ -4222,13 +4236,17 @@ export class AppMessagesManager { const foundDialog = this.getDialogOnly(peerId); if(foundDialog) { + if(historyUpdated.unreadMentions) { + foundDialog.unread_mentions_count -= historyUpdated.unreadMentions; + } + if(historyUpdated.unread) { foundDialog.unread_count -= historyUpdated.unread; rootScope.dispatchEvent('dialog_unread', {peerId}); } - if(historyUpdated.msgs[foundDialog.top_message]) { + if(historyUpdated.msgs.has(foundDialog.top_message)) { this.reloadConversation(peerId); } } @@ -5156,9 +5174,15 @@ export class AppMessagesManager { const history: { count: number, unread: number, - msgs: {[mid: number]: true}, + unreadMentions: number, + msgs: Set, albums?: {[groupId: string]: Set}, - } = {count: 0, unread: 0, msgs: {}}; + } = { + count: 0, + unread: 0, + unreadMentions: 0, + msgs: new Set() + }; for(const mid of messages) { const message: MyMessage = this.getMessageFromStorage(storage, mid); @@ -5169,11 +5193,16 @@ export class AppMessagesManager { this.updateMessageRepliesIfNeeded(message); if(!message.pFlags.out && !message.pFlags.is_outgoing && message.pFlags.unread) { - history.unread++; + ++history.unread; appNotificationsManager.cancel('msg' + mid); + + if(message.pFlags.mentioned) { + ++history.unreadMentions; + } } - history.count++; - history.msgs[mid] = true; + + ++history.count; + history.msgs.add(mid); message.deleted = true; diff --git a/src/lib/rootScope.ts b/src/lib/rootScope.ts index ca7f0b78..1ce57fac 100644 --- a/src/lib/rootScope.ts +++ b/src/lib/rootScope.ts @@ -50,7 +50,7 @@ export type BroadcastEvents = { 'history_update': {storage: MessagesStorage, peerId: number, mid: number}, 'history_reply_markup': {peerId: number}, 'history_multiappend': AppMessagesManager['newMessagesToHandle'], - 'history_delete': {peerId: number, msgs: {[mid: number]: true}}, + 'history_delete': {peerId: number, msgs: Set}, 'history_forbidden': number, 'history_reload': number, 'history_focus': {peerId: number, threadId?: number, mid?: number}, diff --git a/src/scss/partials/_chat.scss b/src/scss/partials/_chat.scss index 52030c97..263ef25f 100644 --- a/src/scss/partials/_chat.scss +++ b/src/scss/partials/_chat.scss @@ -280,8 +280,18 @@ $chat-helper-size: 36px; &.record .tgico-microphone, &.edit .tgico-check, &.schedule .tgico-schedule { - animation: grow-icon .4s forwards ease-in-out !important; visibility: visible !important; + + + } + + @include animation-level(2) { + &.send .tgico-send, + &.record .tgico-microphone, + &.edit .tgico-check, + &.schedule .tgico-schedule { + animation: grow-icon .4s forwards ease-in-out !important; + } } } diff --git a/src/scss/partials/_leftSidebar.scss b/src/scss/partials/_leftSidebar.scss index 3b54f8cf..f3cf42f3 100644 --- a/src/scss/partials/_leftSidebar.scss +++ b/src/scss/partials/_leftSidebar.scss @@ -381,10 +381,16 @@ .btn-corner { &:not(.menu-open) .tgico-newchat_filled, &.menu-open .tgico-close { - animation: grow-icon .4s forwards ease-in-out !important; visibility: visible !important; } + @include animation-level(2) { + &:not(.menu-open) .tgico-newchat_filled, + &.menu-open .tgico-close { + animation: grow-icon .4s forwards ease-in-out !important; + } + } + @include respond-to(handhelds) { --size: 54px; bottom: 14px;