fix(session): refresh furni surfaces on live furnidata merge

mergeFurnitureDataFromUrl dispatched SESSION_DATA_UPDATED, which only drives the
userData snapshot (useUserDataSnapshot) — and it was dispatched here WITHOUT
invalidateUserDataSnapshot(), so the snapshot reference never changed and
consumers bailed out: a no-op. The catalog / inventory / infostand furni name &
description surfaces listen to the window event `nitro-localization-updated` (the
same signal applyFurnidataDelta emits), which the merge never fired — so newly
merged furnidata (e.g. custom/imported.json5 on catalog open) didn't refresh
live. Dispatch `nitro-localization-updated` instead.
This commit is contained in:
simoleo89
2026-06-13 16:31:07 +02:00
parent a49c835870
commit b954ddcd79
+6 -1
View File
@@ -242,7 +242,12 @@ export class SessionDataManager implements ISessionDataManager
const added = await this._furnitureData.mergeFromUrl(url); const added = await this._furnitureData.mergeFromUrl(url);
if(added && added.length) GetEventDispatcher().dispatchEvent(new NitroEvent(NitroEventType.SESSION_DATA_UPDATED)); // Refresh the furni name/desc surfaces (catalog, inventory, infostand)
// via the window event they actually listen to — same signal
// applyFurnidataDelta uses. SESSION_DATA_UPDATED only drives the userData
// snapshot and, dispatched here without invalidateUserDataSnapshot(), was
// a no-op (the snapshot ref never changed, so consumers bailed out).
if(added && added.length && (typeof window !== 'undefined')) window.dispatchEvent(new CustomEvent('nitro-localization-updated'));
return added; return added;
} }