some fixes
This commit is contained in:
parent
53462b2ef6
commit
4782a02a3c
@ -55,6 +55,7 @@ import safeAssign from "../helpers/object/safeAssign";
|
||||
import escapeRegExp from "../helpers/string/escapeRegExp";
|
||||
import limitSymbols from "../helpers/string/limitSymbols";
|
||||
import findAndSplice from "../helpers/array/findAndSplice";
|
||||
import { ScrollStartCallbackDimensions } from "../helpers/fastSmoothScroll";
|
||||
|
||||
//const testScroll = false;
|
||||
|
||||
@ -297,6 +298,8 @@ export default class AppSearchSuper {
|
||||
private searchContextMenu: SearchContextMenu;
|
||||
public selection: SearchSelection;
|
||||
|
||||
public scrollStartCallback: (dimensions: ScrollStartCallbackDimensions) => void;
|
||||
|
||||
constructor(options: Pick<AppSearchSuper, 'mediaTabs' | 'scrollable' | 'searchGroups' | 'asChatList' | 'groupByMonth' | 'hideEmptyTabs' | 'onChangeTab' | 'showSender'>) {
|
||||
safeAssign(this, options);
|
||||
|
||||
@ -407,7 +410,8 @@ export default class AppSearchSuper {
|
||||
if(this.prevTabId === id && !this.skipScroll) {
|
||||
this.scrollable.scrollIntoViewNew({
|
||||
element: this.container,
|
||||
position: 'start'
|
||||
position: 'start',
|
||||
startCallback: this.scrollStartCallback
|
||||
});
|
||||
return;
|
||||
}
|
||||
@ -432,7 +436,8 @@ export default class AppSearchSuper {
|
||||
if(scrollTop < offsetTop) {
|
||||
this.scrollable.scrollIntoViewNew({
|
||||
element: this.container,
|
||||
position: 'start'
|
||||
position: 'start',
|
||||
startCallback: this.scrollStartCallback
|
||||
});
|
||||
scrollTop = offsetTop;
|
||||
}
|
||||
|
@ -2377,6 +2377,7 @@ export default class ChatBubbles {
|
||||
if(!peerId) {
|
||||
this.cleanup(true);
|
||||
this.peerId = peerId;
|
||||
this.preloader.detach();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,10 @@ export default class AppSharedMediaTab extends SliderSuperTab {
|
||||
if(!rect.width) return;
|
||||
|
||||
const top = rect.top - 1;
|
||||
const isSharedMedia = top <= HEADER_HEIGHT;
|
||||
setIsSharedMedia(top <= HEADER_HEIGHT);
|
||||
};
|
||||
|
||||
const setIsSharedMedia = (isSharedMedia: boolean) => {
|
||||
animatedCloseIcon.classList.toggle('state-back', isSharedMedia);
|
||||
this.searchSuper.container.classList.toggle('is-full-viewport', isSharedMedia);
|
||||
transition(+isSharedMedia);
|
||||
@ -208,6 +211,10 @@ export default class AppSharedMediaTab extends SliderSuperTab {
|
||||
}
|
||||
});
|
||||
|
||||
this.searchSuper.scrollStartCallback = () => {
|
||||
setIsSharedMedia(true);
|
||||
};
|
||||
|
||||
this.profile.element.append(this.searchSuper.container);
|
||||
|
||||
const btnAddMembers = ButtonCorner({icon: 'addmember_filled'});
|
||||
|
@ -32,6 +32,7 @@ import Modes from '../../config/modes';
|
||||
import bytesFromHex from '../../helpers/bytes/bytesFromHex';
|
||||
import bytesToHex from '../../helpers/bytes/bytesToHex';
|
||||
import isObject from '../../helpers/object/isObject';
|
||||
import { pause } from '../../helpers/schedulers/pause';
|
||||
|
||||
/// #if !MTPROTO_WORKER
|
||||
import rootScope from '../rootScope';
|
||||
@ -40,7 +41,6 @@ import rootScope from '../rootScope';
|
||||
/// #if MTPROTO_AUTO
|
||||
import transportController from './transports/controller';
|
||||
import MTTransport from './transports/transport';
|
||||
import { pause } from '../../helpers/schedulers/pause';
|
||||
/// #endif
|
||||
|
||||
/* var networker = apiManager.cachedNetworkers.websocket.upload[2];
|
||||
|
@ -13,6 +13,7 @@ import MTTransport, { MTConnectionConstructable } from './transports/transport';
|
||||
import Modes from '../../config/modes';
|
||||
import App from '../../config/app';
|
||||
import indexOfAndSplice from '../../helpers/array/indexOfAndSplice';
|
||||
import { MOUNT_CLASS_TO } from '../../config/debug';
|
||||
|
||||
/// #if MTPROTO_HAS_HTTP
|
||||
import HTTP from './transports/http';
|
||||
@ -162,4 +163,6 @@ export class DcConfigurator {
|
||||
}
|
||||
}
|
||||
|
||||
export default new DcConfigurator();
|
||||
const dcConfigurator = new DcConfigurator();
|
||||
MOUNT_CLASS_TO && (MOUNT_CLASS_TO.dcConfigurator = dcConfigurator);
|
||||
export default dcConfigurator;
|
||||
|
@ -1644,7 +1644,9 @@ export default class MTPNetworker {
|
||||
} */
|
||||
|
||||
private applyServerTime(messageId: string) {
|
||||
return timeManager.applyServerTime(bigInt(messageId).shiftRight(32).toJSNumber());
|
||||
const serverTime = bigInt(messageId).shiftRight(32).toJSNumber();
|
||||
this.log('applying server time', serverTime);
|
||||
return timeManager.applyServerTime(serverTime);
|
||||
}
|
||||
|
||||
// * https://core.telegram.org/mtproto/service_messages_about_messages#notice-of-ignored-error-message
|
||||
@ -1717,7 +1719,11 @@ export default class MTPNetworker {
|
||||
case 32: // * msg_seqno too low
|
||||
case 33: // * msg_seqno too high
|
||||
case 64: { // * invalid container
|
||||
if(message.error_code === 17 || changedTimeOffset) {
|
||||
if(changedTimeOffset === undefined) {
|
||||
this.applyServerTime(messageId);
|
||||
}
|
||||
|
||||
if(message.error_code === 17) {
|
||||
this.log('Update session');
|
||||
this.updateSession();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user