Browse Source

Fix suggesting mentions

master
Eduard Kuzmenko 2 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 {
text: 'ViewDiscussion', text: 'ViewDiscussion',
onClick: () => { onClick: () => {
const middleware = this.chat.bubbles.getMiddleware(); 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) { if(middleware() && channelFull.linked_chat_id) {
this.chat.appImManager.setInnerPeer({ this.chat.appImManager.setInnerPeer({
peerId: channelFull.linked_chat_id.toPeerId(true) peerId: channelFull.linked_chat_id.toPeerId(true)

8
src/lib/appManagers/appProfileManager.ts

@ -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) { 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({ return apiManager.invokeApiSingleProcess({
@ -457,8 +457,8 @@ export class AppProfileManager {
return cP.participants.map(p => appChatsManager.getParticipantPeerId(p)); return cP.participants.map(p => appChatsManager.getParticipantPeerId(p));
}); });
} else if(chatId) { } else if(chatId) {
promise = (this.getChatFull(chatId) as Promise<ChatFull.chatFull>).then(chatFull => { promise = Promise.resolve(this.getChatFull(chatId)).then(chatFull => {
return (chatFull.participants as ChatParticipants.chatParticipants).participants.map(p => p.user_id.toPeerId()); return ((chatFull as ChatFull.chatFull).participants as ChatParticipants.chatParticipants).participants.map(p => p.user_id.toPeerId());
}); });
} else { } else {
promise = Promise.resolve([]); promise = Promise.resolve([]);

Loading…
Cancel
Save