From 7728d82fa2d4d5d8d856ae7c5e8aec4798495a49 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Tue, 4 May 2021 17:49:00 +0400 Subject: [PATCH] Build --- src/lib/appManagers/appDialogsManager.ts | 2 ++ src/lib/appManagers/appPeersManager.ts | 4 ++-- src/lib/appManagers/appProfileManager.ts | 15 ++++++++++----- src/scss/partials/_chatBubble.scss | 7 ++++--- src/scss/partials/_profile.scss | 6 +++--- src/scss/partials/_rightSidebar.scss | 12 ++++++++---- 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/lib/appManagers/appDialogsManager.ts b/src/lib/appManagers/appDialogsManager.ts index 889ce86a..b8b49784 100644 --- a/src/lib/appManagers/appDialogsManager.ts +++ b/src/lib/appManagers/appDialogsManager.ts @@ -837,6 +837,8 @@ export class AppDialogsManager { } private onListLengthChange = () => { + return; + const emptyFolder = this.chatList.parentElement.querySelector('.empty-folder'); if(this.scroll.loadedAll.bottom && !this.chatList.childElementCount) { if(emptyFolder) { diff --git a/src/lib/appManagers/appPeersManager.ts b/src/lib/appManagers/appPeersManager.ts index 6a02c29b..f04e5124 100644 --- a/src/lib/appManagers/appPeersManager.ts +++ b/src/lib/appManagers/appPeersManager.ts @@ -9,10 +9,10 @@ * https://github.com/zhukov/webogram/blob/master/LICENSE */ +import type { ChatPhoto, DialogPeer, InputDialogPeer, InputNotifyPeer, InputPeer, Peer, Update, UserProfilePhoto } from "../../layer"; +import type { LangPackKey } from "../langPack"; import { MOUNT_CLASS_TO } from "../../config/debug"; import { isObject } from "../../helpers/object"; -import { ChatPhoto, DialogPeer, InputDialogPeer, InputNotifyPeer, InputPeer, Peer, Update, UserProfilePhoto } from "../../layer"; -import { LangPackKey } from "../langPack"; import { RichTextProcessor } from "../richtextprocessor"; import rootScope from "../rootScope"; import appChatsManager from "./appChatsManager"; diff --git a/src/lib/appManagers/appProfileManager.ts b/src/lib/appManagers/appProfileManager.ts index a5cd5b48..bb48b2dd 100644 --- a/src/lib/appManagers/appProfileManager.ts +++ b/src/lib/appManagers/appProfileManager.ts @@ -14,7 +14,7 @@ import { tsNow } from "../../helpers/date"; import { replaceContent } from "../../helpers/dom"; import renderImageFromUrl from "../../helpers/dom/renderImageFromUrl"; import sequentialDom from "../../helpers/sequentialDom"; -import { ChannelParticipantsFilter, ChannelsChannelParticipants, Chat, ChatFull, ChatParticipants, ChatPhoto, ExportedChatInvite, InputChannel, InputFile, InputFileLocation, PhotoSize, UserFull, UserProfilePhoto } from "../../layer"; +import { ChannelParticipantsFilter, ChannelsChannelParticipants, Chat, ChatFull, ChatParticipants, ChatPhoto, ExportedChatInvite, InputChannel, InputFile, InputFileLocation, PhotoSize, Update, UserFull, UserProfilePhoto } from "../../layer"; //import apiManager from '../mtproto/apiManager'; import apiManager from '../mtproto/mtprotoworker'; import { RichTextProcessor } from "../richtextprocessor"; @@ -376,7 +376,7 @@ export class AppProfileManager { updates: [{ _: 'updateChannel', channel_id: id - }], + } as Update.updateChannel], chats: [channel], users: [] }); @@ -426,7 +426,7 @@ export class AppProfileManager { date: tsNow(true), photo: appUsersManager.getUser(myId).photo, previous: true - } + } as Update.updateUserPhoto }); }); } @@ -520,6 +520,10 @@ export class AppProfileManager { } const renderPromise = loadPromise.then((url) => { + /* if(photo.stripped_thumb) { + url = appPhotosManager.getPreviewURLFromBytes(photo.stripped_thumb); + } */ + return new Promise((resolve) => { renderImageFromUrl(img, url, () => { callback(); @@ -537,7 +541,7 @@ export class AppProfileManager { const size: PeerPhotoSize = 'photo_small'; const avatarAvailable = !!photo; - const avatarRendered = !!div.firstElementChild; + const avatarRendered = div.firstElementChild && !(div.firstElementChild as HTMLElement).classList.contains('emoji'); const myId = rootScope.myId; @@ -573,7 +577,8 @@ export class AppProfileManager { let abbr: string; if(!title) { - abbr = appPeersManager.getPeer(peerId).initials ?? ''; + const peer = appPeersManager.getPeer(peerId); + abbr = peer.initials ?? ''; } else { abbr = RichTextProcessor.getAbbreviation(title); } diff --git a/src/scss/partials/_chatBubble.scss b/src/scss/partials/_chatBubble.scss index dfbd642a..4e3de500 100644 --- a/src/scss/partials/_chatBubble.scss +++ b/src/scss/partials/_chatBubble.scss @@ -1625,6 +1625,7 @@ $bubble-margin: .25rem; .bubble-content { background-color: transparent; + border-radius: .875rem; } .service-msg { @@ -1632,9 +1633,9 @@ $bubble-margin: .25rem; //background-color: rgba(0, 0, 0, .24); background-color: var(--message-highlightning-color); font-size: .9375rem; - padding: .28125rem .5rem; - line-height: 1.3125; - border-radius: .75rem; + padding: .28125rem .625rem; + line-height: var(--line-height); + border-radius: inherit; user-select: none; display: flex; align-items: center; diff --git a/src/scss/partials/_profile.scss b/src/scss/partials/_profile.scss index b7777a24..16e42645 100644 --- a/src/scss/partials/_profile.scss +++ b/src/scss/partials/_profile.scss @@ -117,14 +117,14 @@ flex: 1 1 auto; border-radius: 4px; margin: 0 .125rem; - background-color: var(--secondary-color); - opacity: .3; + background-color: #fff; + opacity: .2; transition: opacity .2s ease-in-out; //min-width: 1.6875rem; height: inherit; &.active { - opacity: 1; + opacity: .6; } } } diff --git a/src/scss/partials/_rightSidebar.scss b/src/scss/partials/_rightSidebar.scss index 9d552d55..18d89018 100644 --- a/src/scss/partials/_rightSidebar.scss +++ b/src/scss/partials/_rightSidebar.scss @@ -19,12 +19,13 @@ } @include respond-to(not-handhelds) { - width: var(--right-column-width); + width: calc(var(--right-column-width)); transition: transform var(--transition-standard-out); position: absolute; right: 0; z-index: 3; - transform: translate3d(calc(var(--right-column-width)), 0, 0); + transform: translate3d(var(--right-column-width), 0, 0); + //transform: translate3d(calc(var(--right-column-width) + 1px), 0, 0); .sidebar-content { min-width: var(--right-column-width); @@ -47,15 +48,18 @@ position: absolute; content: " "; display: block; - height: 56px; + //height: 56px; + height: 100vh; width: 1px; background-color: var(--border-color); - left: -1px; + left: 0px; top: 0; } */ } @include respond-to(medium-screens) { + width: calc(var(--right-column-width) + 1px); + transform: translate3d(calc(var(--right-column-width) + 1px), 0, 0); border-left: 1px solid var(--border-color); }