[Glitch] Fix clicking a status multiple times causing duplicate entries in browser history

Port ac039d5f13 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
Claire
2025-06-21 11:00:38 +02:00
parent f41981e772
commit 13a07e44f1

View File

@@ -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);
}
}
};