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

pull/1839/head
audric 4 years ago
parent 83fa26bc25
commit 1eb2e59d62

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

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

Loading…
Cancel
Save