Files
WT-Offline/gui-patches/online-shop/refresh-profile-after-browser-close/patch.json
T
N0VAN0M4LY e40a4e4e7d fix(profile): refresh profiles when commerce windows close
Use the existing entitlement refresh task when leaving the local store, marketplace, currency shop, or Premium Account shop. Use the same path for the explicit and ordinary browser close actions.

Verified GUI patch application and Quirrel syntax.
2026-11-26 10:00:19 +08:00

32 lines
2.4 KiB
JSON

{
"id": "online-shop/refresh-profile-after-browser-close",
"title": "Refresh the current profile when the embedded commerce browser closes",
"file": "scripts/onlineshop/browserwnd.nut",
"program_behaviour": {
"stock": "Destroying the browser broadcasts its normal close event. Only the dedicated update button requests the profile, subject to the shared cooldown.",
"patched": "Closing a local store or marketplace page through any browser close path requests an immediate profile update."
},
"derivation": {
"requirement": "Refresh the hangar after the local store or marketplace is closed, including when no purchase was made.",
"cause": "The local web request cannot observe the browser close. The existing update command can also omit a quick repeat close within its 20-second cooldown.",
"lighter_options_ruled_out": [
"The local service observes requests and grants. The window lifecycle is managed by the client.",
"Keep the refetch on the dedicated button. Ordinary close paths still omit the refresh, and rapid repeats hit its cooldown."
],
"if_not_applied": "A local browser window can close with stale purchase information in the hangar."
},
"features": [
"G-Store",
"G-Marketplace"
],
"evidence": [
"2.61.0.37 scripts/onlineshop/browserwnd.nut: BrowserModalHandler.onDestroy and browserCloseAndUpdateEntitlements.",
"2.61.0.37 scripts/onlineshop/entitlementsupdate.nut: updateEntitlementsLimited(true) forces a refresh when the char service is available.",
"packages/build/src/network/redirect-network-config.ts and scripts/inventory/inventoryclient.nut: local storefront and marketplace entry paths."
],
"edit": {
"find": " function onDestroy() {\r\n broadcastEvent(\"DestroyEmbeddedBrowser\")\r\n }",
"replace": " function isLocalCommercePage() {\r\n let queryStart = this.url.indexof(\"?\")\r\n let page = queryStart == null ? this.url : this.url.slice(0, queryStart)\r\n return page == \"http://{{LOCAL_ENDPOINT}}/store\"\r\n || page == \"http://{{LOCAL_ENDPOINT}}/store/\"\r\n || page == \"http://{{LOCAL_ENDPOINT}}/trade.gaijin.net\"\r\n || page == \"http://{{LOCAL_ENDPOINT}}/trade.gaijin.net/\"\r\n }\r\n\r\n function onDestroy() {\r\n broadcastEvent(\"DestroyEmbeddedBrowser\")\r\n if (this.isLocalCommercePage())\r\n addTask(updateEntitlementsLimited(true), null, @() updateGamercards())\r\n }"
}
}