Browse Source

Fix suggesting mentions

master
Eduard Kuzmenko 3 years ago
parent
commit
3b35df4137
  1. 2
      src/components/chat/topbar.ts
  2. 8
      src/lib/appManagers/appProfileManager.ts

2
src/components/chat/topbar.ts

@ -334,7 +334,7 @@ export default class ChatTopbar { @@ -334,7 +334,7 @@ export default class ChatTopbar {
text: 'ViewDiscussion',
onClick: () => {
const middleware = this.chat.bubbles.getMiddleware();
this.appProfileManager.getChannelFull(this.peerId.toChatId()).then(channelFull => {
Promise.resolve(this.appProfileManager.getChannelFull(this.peerId.toChatId())).then(channelFull => {
if(middleware() && channelFull.linked_chat_id) {
this.chat.appImManager.setInnerPeer({
peerId: channelFull.linked_chat_id.toPeerId(true)

8
src/lib/appManagers/appProfileManager.ts

@ -373,9 +373,9 @@ export class AppProfileManager { @@ -373,9 +373,9 @@ export class AppProfileManager {
});
}
public getChannelFull(id: ChatId, override?: true): Promise<ChatFull.channelFull> {
public getChannelFull(id: ChatId, override?: true) {
if(this.chatsFull[id] !== undefined && !override) {
return Promise.resolve(this.chatsFull[id] as ChatFull.channelFull);
return this.chatsFull[id] as ChatFull.channelFull;
}
return apiManager.invokeApiSingleProcess({
@ -457,8 +457,8 @@ export class AppProfileManager { @@ -457,8 +457,8 @@ export class AppProfileManager {
return cP.participants.map(p => appChatsManager.getParticipantPeerId(p));
});
} else if(chatId) {
promise = (this.getChatFull(chatId) as Promise<ChatFull.chatFull>).then(chatFull => {
return (chatFull.participants as ChatParticipants.chatParticipants).participants.map(p => p.user_id.toPeerId());
promise = Promise.resolve(this.getChatFull(chatId)).then(chatFull => {
return ((chatFull as ChatFull.chatFull).participants as ChatParticipants.chatParticipants).participants.map(p => p.user_id.toPeerId());
});
} else {
promise = Promise.resolve([]);

Loading…
Cancel
Save