mirror of
https://github.com/hansjone/netx.git
synced 2026-10-09 19:00:46 +08:00
fix: collection first-run pending and module tab cross-nav
Defer collection scheduling to BackgroundTasks after commit; claim pending runs atomically with retries. Only handle focus-module broadcasts for the matching moduleId so opening one module does not rewrite other tabs. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
3413d5bf32
commit
fed7f56ad0
5 changed files with 169 additions and 43 deletions
|
|
@ -36,13 +36,18 @@ export function registerModuleWindow(moduleId: string): () => void {
|
|||
/* ignore */
|
||||
}
|
||||
|
||||
return registerBroadcastListener<FocusModuleMessage>(MODULE_CHANNEL, moduleAckKey(moduleId), (data) => {
|
||||
const targetPath = String(data.path || "").trim();
|
||||
if (targetPath && window.location.pathname !== targetPath) {
|
||||
window.location.assign(targetPath);
|
||||
}
|
||||
window.focus();
|
||||
});
|
||||
return registerBroadcastListener<FocusModuleMessage>(
|
||||
MODULE_CHANNEL,
|
||||
moduleAckKey(moduleId),
|
||||
(data) => {
|
||||
const targetPath = String(data.path || "").trim();
|
||||
if (targetPath && window.location.pathname !== targetPath) {
|
||||
window.location.assign(targetPath);
|
||||
}
|
||||
window.focus();
|
||||
},
|
||||
(data) => data.moduleId === moduleId,
|
||||
);
|
||||
}
|
||||
|
||||
export function openOrFocusModule({ moduleId, path }: ModuleWindowSpec): void {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue