mirror of
https://github.com/revoltchat/revite.git
synced 2024-12-24 06:32:08 -05:00
Fix: Prevent clicking on links in reply / channel header.
Jump to existing message if exists.
This commit is contained in:
parent
3075fc8e32
commit
b806902bc4
3 changed files with 18 additions and 1 deletions
|
@ -45,10 +45,13 @@ export const ReplyBase = styled.div<{
|
|||
.content {
|
||||
gap: 4px;
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
|
||||
cursor: pointer;
|
||||
> * {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
> svg:first-child {
|
||||
|
|
|
@ -73,6 +73,16 @@ export class SingletonRenderer extends EventEmitter3 {
|
|||
}
|
||||
|
||||
async init(id: string, message_id?: string) {
|
||||
if (message_id) {
|
||||
if (this.state.type === 'RENDER') {
|
||||
let message = this.state.messages.find(x => x._id === message_id);
|
||||
if (message) {
|
||||
this.emit("scroll", { type: "ScrollToView", id: message_id });
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.channel = id;
|
||||
this.stale = false;
|
||||
this.setStateUnguarded({ type: "LOADING" });
|
||||
|
|
|
@ -58,6 +58,10 @@ const Info = styled.div`
|
|||
font-size: 0.8em;
|
||||
font-weight: 400;
|
||||
color: var(--secondary-foreground);
|
||||
|
||||
> * {
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
|
|
Loading…
Reference in a new issue