amke sure to reset link previews when replacing the text in composition

This commit is contained in:
audric 2021-08-10 15:47:55 +10:00
parent 83fa26bc25
commit 1eb2e59d62
2 changed files with 7 additions and 1 deletions

View File

@ -551,6 +551,11 @@ class SessionCompositionBoxInner extends React.Component<Props, State> {
// we try to match the first link found in the current message
const links = window.Signal.LinkPreviews.findLinks(this.props.draft, undefined);
if (!links || links.length === 0 || ignoredLink === links[0]) {
if (this.state.stagedLinkPreview) {
this.setState({
stagedLinkPreview: undefined,
});
}
return <></>;
}
const firstLink = links[0];

View File

@ -44,6 +44,7 @@ import { getOpenGroupV2FromConversationId } from '../opengroup/utils/OpenGroupUt
import { createTaskWithTimeout } from '../session/utils/TaskWithTimeout';
import { perfEnd, perfStart } from '../session/utils/Performance';
import { ReplyingToMessageProps } from '../components/session/conversation/SessionCompositionBox';
import { ed25519Str } from '../session/onions/onionPath';
export enum ConversationTypeEnum {
GROUP = 'group',
@ -231,7 +232,7 @@ export class ConversationModel extends Backbone.Model<ConversationAttributes> {
return `opengroup(${this.id})`;
}
return `group(${this.id})`;
return `group(${ed25519Str(this.id)})`;
}
public isMe() {