Telegram Web K with changes to work inside I2P
https://web.telegram.i2p/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.3 KiB
40 lines
1.3 KiB
4 years ago
|
import { isTouchSupported } from "../../helpers/touchSupport";
|
||
|
import appImManager from "../../lib/appManagers/appImManager";
|
||
|
import AppSelectPeers from "../appSelectPeers";
|
||
|
import PopupElement from ".";
|
||
4 years ago
|
|
||
|
export default class PopupForward extends PopupElement {
|
||
|
private selector: AppSelectPeers;
|
||
|
//private scrollable: Scrollable;
|
||
|
|
||
4 years ago
|
constructor(fromPeerId: number, mids: number[], onSelect?: () => Promise<void> | void, onClose?: () => void) {
|
||
4 years ago
|
super('popup-forward', null, {closable: true, overlayClosable: true, body: true});
|
||
|
|
||
|
if(onClose) this.onClose = onClose;
|
||
4 years ago
|
|
||
|
this.selector = new AppSelectPeers(this.body, async() => {
|
||
4 years ago
|
const peerId = this.selector.getSelected()[0];
|
||
4 years ago
|
this.btnClose.click();
|
||
4 years ago
|
|
||
|
this.selector = null;
|
||
|
|
||
|
await (onSelect ? onSelect() || Promise.resolve() : Promise.resolve());
|
||
|
|
||
4 years ago
|
appImManager.setInnerPeer(peerId);
|
||
4 years ago
|
appImManager.chat.input.initMessagesForward(fromPeerId, mids.slice());
|
||
4 years ago
|
}, ['dialogs', 'contacts'], () => {
|
||
|
this.show();
|
||
4 years ago
|
this.selector.checkForTriggers(); // ! due to zero height before mounting
|
||
4 years ago
|
|
||
|
if(!isTouchSupported) {
|
||
|
this.selector.input.focus();
|
||
|
}
|
||
4 years ago
|
}, null, 'send', false);
|
||
|
|
||
|
//this.scrollable = new Scrollable(this.body);
|
||
|
|
||
|
this.selector.input.placeholder = 'Forward to...';
|
||
|
this.title.append(this.selector.input);
|
||
|
}
|
||
|
|
||
|
}
|