From 13a07e44f1fa8fa99af111660b3015c677cdfebc Mon Sep 17 00:00:00 2001 From: Claire Date: Sat, 21 Jun 2025 11:00:38 +0200 Subject: [PATCH] [Glitch] Fix clicking a status multiple times causing duplicate entries in browser history Port ac039d5f1323c46062d004896996f50549bfa38b to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/components/status.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/components/status.jsx b/app/javascript/flavours/glitch/components/status.jsx index 4b5c23280d..4070ea2913 100644 --- a/app/javascript/flavours/glitch/components/status.jsx +++ b/app/javascript/flavours/glitch/components/status.jsx @@ -377,7 +377,11 @@ class Status extends ImmutablePureComponent { if (newTab) { window.open(path, '_blank', 'noopener'); } else { - history.push(path); + if (history.location.pathname.replace('/deck/', '/') === path) { + history.replace(path); + } else { + history.push(path); + } } };