From 44adec01f6050e90de6e181c285714aa6acbb26e Mon Sep 17 00:00:00 2001 From: N0VAN0M4LY <224130499+N0VAN0M4LY@users.noreply.github.com> Date: Thu, 26 Nov 2026 10:14:58 +0800 Subject: [PATCH] Honor configured marketplace fees and validate result text Display the fee supplied by the marketplace service. Use the unconfirmed notice when the returned message is missing or invalid. --- packages/local-service/src/inventory/web/app.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/local-service/src/inventory/web/app.js b/packages/local-service/src/inventory/web/app.js index 4ad47c0..c0c55d2 100644 --- a/packages/local-service/src/inventory/web/app.js +++ b/packages/local-service/src/inventory/web/app.js @@ -34,7 +34,7 @@ const t = (key, params) => WtoUi.tr(T, key, params); const $ = (id) => document.getElementById(id); const wantedItem = WtoUi.query.get('n') || ''; -let state = { accounts: [], currentUserId: '', balance: { gjnCents: 0, goldenEagles: 0 }, sellFeeRate: 0.15, listings: [] }; +let state = { accounts: [], currentUserId: '', balance: { gjnCents: 0, goldenEagles: 0 }, listings: [] }; const activeCats = new Set(); let openedWanted = false; let tradeNoticeId = 0; @@ -165,7 +165,7 @@ function openDetail(listing) { } function fillOrderColumns(detail, listing) { - const fee = Math.round((state.sellFeeRate || 0) * 100); + const fee = Math.round(state.sellFeeRate * 100); const sellCol = detail.querySelector('.sell-col'); const buyCol = detail.querySelector('.buy-col'); const noAccount = !state.currentUserId; @@ -206,7 +206,7 @@ async function trade(url, body, listing) { return; } const message = WtoUi.text(result?.message); - if (typeof result?.ok !== 'boolean' || !message) { + if (typeof result?.ok !== 'boolean' || typeof message !== 'string' || !message) { showResult(t('tradeUnconfirmed'), false); return; }