You've already forked Nitro_Render_V3
mirror of
https://github.com/duckietm/Nitro_Render_V3.git
synced 2026-06-19 15:06:20 +00:00
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:
@@ -242,7 +242,12 @@ export class SessionDataManager implements ISessionDataManager
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user