From 3cb54f227a67263a3d5209df4e1f3a19b1f9f302 Mon Sep 17 00:00:00 2001 From: shubhsherl Date: Sat, 11 Apr 2020 22:21:21 +0530 Subject: [PATCH 1/2] fix quote message redirect in pwa --- .../client/messageAttachment.html | 12 ++++++------ .../client/stylesheets/messageAttachments.css | 8 +++++++- app/ui/client/views/app/room.js | 8 +++++--- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/app/message-attachments/client/messageAttachment.html b/app/message-attachments/client/messageAttachment.html index e1d5930c4634..371089c2e242 100644 --- a/app/message-attachments/client/messageAttachment.html +++ b/app/message-attachments/client/messageAttachment.html @@ -18,9 +18,9 @@ {{author_name}} {{#if ts}} {{#if message_link}} - - {{time}} - + {{else}} {{#unless time}} @@ -38,9 +38,9 @@ {{author_name}} {{#if ts}} {{#if message_link}} - - {{time}} - + {{else}} {{#unless time}} diff --git a/app/message-attachments/client/stylesheets/messageAttachments.css b/app/message-attachments/client/stylesheets/messageAttachments.css index 32b9e1c3d1f9..c861675d7f5c 100644 --- a/app/message-attachments/client/stylesheets/messageAttachments.css +++ b/app/message-attachments/client/stylesheets/messageAttachments.css @@ -57,8 +57,14 @@ html.rtl .attachment { margin-bottom: -2px; } - & .time, + & .time { + font-size: 0.8em; + font-weight: normal; + } + & .time-link { + color: #1d74f5; + font-size: 0.8em; font-weight: normal; } diff --git a/app/ui/client/views/app/room.js b/app/ui/client/views/app/room.js index 3a0011fc92e8..c3db892b56a3 100644 --- a/app/ui/client/views/app/room.js +++ b/app/ui/client/views/app/room.js @@ -878,11 +878,13 @@ Template.room.events({ popover.open(config); }, - 'click .time a'(e) { + 'click .time-link'(e) { e.preventDefault(); const { msg } = messageArgs(this); - const repliedMessageId = msg.attachments[0].message_link.split('?msg=')[1]; - FlowRouter.go(FlowRouter.current().context.pathname, null, { msg: repliedMessageId, hash: Random.id() }); + const link = msg.attachments ? msg.attachments[0].message_link : this.message_link; + const repliedMessageId = link.split('?msg=')[1]; + const pathname = `/${ link.split('?msg=')[0].split('/').slice(-2)[0] }/${ link.split('?msg=')[0].split('/').slice(-1)[0] }`; + FlowRouter.go(pathname, null, { msg: repliedMessageId, hash: Random.id() }); }, 'click .mention-link'(e, instance) { if (!Meteor.userId()) { From 9b4fd0c202f2c40a5e740028c00d19b743cfd290 Mon Sep 17 00:00:00 2001 From: shubhsherl Date: Tue, 14 Apr 2020 22:09:52 +0530 Subject: [PATCH 2/2] use URL function to extract pathname --- app/ui/client/views/app/room.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/ui/client/views/app/room.js b/app/ui/client/views/app/room.js index c3db892b56a3..5273884a5043 100644 --- a/app/ui/client/views/app/room.js +++ b/app/ui/client/views/app/room.js @@ -883,7 +883,7 @@ Template.room.events({ const { msg } = messageArgs(this); const link = msg.attachments ? msg.attachments[0].message_link : this.message_link; const repliedMessageId = link.split('?msg=')[1]; - const pathname = `/${ link.split('?msg=')[0].split('/').slice(-2)[0] }/${ link.split('?msg=')[0].split('/').slice(-1)[0] }`; + const { pathname } = new URL(link); FlowRouter.go(pathname, null, { msg: repliedMessageId, hash: Random.id() }); }, 'click .mention-link'(e, instance) {