feat: a share link pasted into an open tab is handled like a fresh arrival
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU
This commit is contained in:
parent
fa5ed6c2b4
commit
4de76dbfd9
1 changed files with 9 additions and 0 deletions
|
|
@ -495,6 +495,15 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
// Expose activateTab globally so auth.js can call it after login
|
||||
window.activateTab = activateTab;
|
||||
|
||||
// A share link pasted into a tab that is already open changes only the hash,
|
||||
// so nothing reloads. Treat it like a fresh arrival: note the token, open My
|
||||
// Resources, and let it ask whether to add the resource.
|
||||
window.addEventListener('hashchange', function() {
|
||||
var wanted = null;
|
||||
try { wanted = openTabFromHash(window, document, window.localStorage); } catch (e) {}
|
||||
if (wanted && window.CURRENT_USER) activateTab(wanted);
|
||||
});
|
||||
|
||||
document.querySelectorAll('.tab-btn').forEach(function(btn) {
|
||||
btn.addEventListener('click', function() {
|
||||
activateTab(btn.getAttribute('data-tab'));
|
||||
|
|
|
|||
Loading…
Reference in a new issue