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.
41 lines
985 B
41 lines
985 B
![]()
4 years ago
|
import appMessagesManager from "../lib/appManagers/appMessagesManager";
|
||
|
import { PopupButton } from "./popup";
|
||
|
import PopupPeer from "./popupPeer";
|
||
|
|
||
|
export default class PopupPinMessage {
|
||
|
constructor(peerID: number, mid: number) {
|
||
|
let title: string, description: string, buttons: PopupButton[] = [];
|
||
|
|
||
|
const callback = () => appMessagesManager.updatePinnedMessage(peerID, mid);
|
||
|
if(mid) {
|
||
|
title = 'Pin Message?';
|
||
|
description = 'Would you like to pin this message?';
|
||
|
buttons.push({
|
||
|
text: 'PIN',
|
||
|
callback
|
||
|
});
|
||
|
} else {
|
||
|
title = `Unpin Message?`;
|
||
|
description = 'Would you like to unpin this message?';
|
||
|
buttons.push({
|
||
|
text: 'UNPIN',
|
||
|
isDanger: true,
|
||
|
callback
|
||
|
});
|
||
|
}
|
||
|
|
||
|
buttons.push({
|
||
|
text: 'CANCEL',
|
||
|
isCancel: true
|
||
|
});
|
||
|
|
||
|
const popup = new PopupPeer('popup-delete-chat', {
|
||
|
peerID,
|
||
|
title,
|
||
|
description,
|
||
|
buttons
|
||
|
});
|
||
|
|
||
|
popup.show();
|
||
|
}
|
||
|
}
|