diff --git a/src/components/chat/bubbles.ts b/src/components/chat/bubbles.ts index c66025bb..451e77e9 100644 --- a/src/components/chat/bubbles.ts +++ b/src/components/chat/bubbles.ts @@ -51,6 +51,7 @@ import PeerTitle from "../peerTitle"; import { forEachReverse } from "../../helpers/array"; import findUpClassName from "../../helpers/dom/findUpClassName"; import findUpTag from "../../helpers/dom/findUpTag"; +import { toast } from "../toast"; const USE_MEDIA_TAILS = false; const IGNORE_ACTIONS: Message.messageService['action']['_'][] = [/* 'messageActionHistoryClear' */]; @@ -828,8 +829,8 @@ export default class ChatBubbles { //appSidebarRight.forwardTab.open([mid]); return; } else if(target.classList.contains('peer-title') || target.classList.contains('name')) { + target = findUpClassName(target, 'name'); const peerId = +target.dataset.peerId; - const savedFrom = target.dataset.savedFrom; if(savedFrom) { const splitted = savedFrom.split('_'); @@ -840,6 +841,8 @@ export default class ChatBubbles { } else { if(peerId) { this.chat.appImManager.setInnerPeer(peerId); + } else { + toast(I18n.format('HidAccount', true)); } } @@ -849,6 +852,8 @@ export default class ChatBubbles { if(peerId) { this.chat.appImManager.setInnerPeer(peerId); + } else { + toast(I18n.format('HidAccount', true)); } return; @@ -883,6 +888,8 @@ export default class ChatBubbles { if(peerId) { this.chat.appImManager.setInnerPeer(peerId); + } else { + toast(I18n.format('HidAccount', true)); } } @@ -2394,6 +2401,7 @@ export default class ChatBubbles { ///////this.log('message to render hidden', message); title = document.createElement('span'); title.innerHTML = RichTextProcessor.wrapEmojiText(message.fwd_from.from_name); + title.classList.add('peer-title'); //title = message.fwd_from.from_name; bubble.classList.add('hidden-profile'); } else { diff --git a/src/components/chat/stickersHelper.ts b/src/components/chat/stickersHelper.ts index 79c0ecd2..f5d9813e 100644 --- a/src/components/chat/stickersHelper.ts +++ b/src/components/chat/stickersHelper.ts @@ -82,10 +82,7 @@ export default class StickersHelper { private init() { this.container = document.createElement('div'); this.container.classList.add('stickers-helper', 'z-depth-1'); - - this.stickersContainer = document.createElement('div'); - this.stickersContainer.classList.add('stickers-helper-stickers', 'super-stickers'); - this.stickersContainer.addEventListener('click', (e) => { + this.container.addEventListener('click', (e) => { if(!findUpClassName(e.target, 'super-sticker')) { return; } @@ -93,6 +90,9 @@ export default class StickersHelper { EmoticonsDropdown.onMediaClick(e, true); }); + this.stickersContainer = document.createElement('div'); + this.stickersContainer.classList.add('stickers-helper-stickers', 'super-stickers'); + this.container.append(this.stickersContainer); this.scrollable = new Scrollable(this.container); diff --git a/src/lang.ts b/src/lang.ts index f2a81f8c..25ac0fb7 100644 --- a/src/lang.ts +++ b/src/lang.ts @@ -379,6 +379,7 @@ const lang = { "one_value": "%1$d sticker", "other_value": "%1$d stickers" }, + "HidAccount": "The account was hidden by the user", // * macos "AccountSettings.Filters": "Chat Folders", diff --git a/src/lib/appManagers/appImManager.ts b/src/lib/appManagers/appImManager.ts index 1c4b8990..d61a1cab 100644 --- a/src/lib/appManagers/appImManager.ts +++ b/src/lib/appManagers/appImManager.ts @@ -622,7 +622,8 @@ export class AppImManager { spliced = this.chats.splice(fromIndex, this.chats.length - fromIndex); } - for(let i = 0; i < spliced.length; ++i) { + // * -1 because one item is being sliced when closing the chat by calling .removeByType + for(let i = 0; i < spliced.length - 1; ++i) { appNavigationController.removeByType('chat', true); } diff --git a/src/scss/partials/_chat.scss b/src/scss/partials/_chat.scss index b1a8edcc..0dc9009e 100644 --- a/src/scss/partials/_chat.scss +++ b/src/scss/partials/_chat.scss @@ -481,10 +481,6 @@ $chat-helper-size: 39px; } } - /* @include respond-to(not-handhelds) { - border-left: 1px solid var(--border-color); - } */ - @include respond-to(floating-left-sidebar) { position: fixed !important; left: 0; @@ -492,7 +488,10 @@ $chat-helper-size: 39px; bottom: 0; right: 0; transform: translateZ(0); - transition: transform var(--layer-transition) !important; + + @include animation-level(2) { + transition: transform var(--layer-transition); + } body.is-left-column-shown & { transform: translate3d(26.5rem, 0, 0); diff --git a/src/scss/partials/_chatBubble.scss b/src/scss/partials/_chatBubble.scss index e317e5e6..82e2f7a8 100644 --- a/src/scss/partials/_chatBubble.scss +++ b/src/scss/partials/_chatBubble.scss @@ -144,6 +144,10 @@ $bubble-margin: .25rem; &:before, &:after { display: none; } + + .user-avatar { + z-index: 2; + } } &.channel-post {