From 84d5cf4541919ad4e73752b355f7ddf3914ad7b2 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Thu, 27 Feb 2020 15:04:50 +1100 Subject: [PATCH] fix contextmenu caching on Message right click --- ts/components/conversation/Message.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ts/components/conversation/Message.tsx b/ts/components/conversation/Message.tsx index e841079c5..c06ad4161 100644 --- a/ts/components/conversation/Message.tsx +++ b/ts/components/conversation/Message.tsx @@ -1064,9 +1064,13 @@ export class Message extends React.PureComponent { // This id is what connects our triple-dot click with our associated pop-up menu. // It needs to be unique. - const triggerId = String(id || `${authorPhoneNumber}-${timestamp}`); - const rightClickTriggerId = `${authorPhoneNumber}-ctx-${timestamp}`; - + // The Date.now() is a workaround to be sure a single triggerID with this id exists + const triggerId = id + ? String(`${id}-${Date.now()}`) + : String(`${authorPhoneNumber}-${timestamp}`); + const rightClickTriggerId = id + ? String(`${id}-ctx-${Date.now()}`) + : String(`${authorPhoneNumber}-ctx-${timestamp}`); if (expired) { return null; }