Browse Source

Fix returning from inner chats

Hidden user toast
Fix sending stickers from helper
master
Eduard Kuzmenko 4 years ago
parent
commit
22b3858864
  1. 10
      src/components/chat/bubbles.ts
  2. 8
      src/components/chat/stickersHelper.ts
  3. 1
      src/lang.ts
  4. 3
      src/lib/appManagers/appImManager.ts
  5. 9
      src/scss/partials/_chat.scss
  6. 4
      src/scss/partials/_chatBubble.scss

10
src/components/chat/bubbles.ts

@ -51,6 +51,7 @@ import PeerTitle from "../peerTitle"; @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 {

8
src/components/chat/stickersHelper.ts

@ -82,10 +82,7 @@ export default class StickersHelper { @@ -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 { @@ -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);

1
src/lang.ts

@ -379,6 +379,7 @@ const lang = { @@ -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",

3
src/lib/appManagers/appImManager.ts

@ -622,7 +622,8 @@ export class AppImManager { @@ -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);
}

9
src/scss/partials/_chat.scss

@ -481,10 +481,6 @@ $chat-helper-size: 39px; @@ -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; @@ -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);

4
src/scss/partials/_chatBubble.scss

@ -144,6 +144,10 @@ $bubble-margin: .25rem; @@ -144,6 +144,10 @@ $bubble-margin: .25rem;
&:before, &:after {
display: none;
}
.user-avatar {
z-index: 2;
}
}
&.channel-post {

Loading…
Cancel
Save