Skip to content

fix: stop the inventory script crashing when the old sell dialog is gone - #294

Merged
ganey merged 1 commit into
SteamDatabase:masterfrom
ganey:fix/inventory-sell-dialog-guard
Dec 4, 2026
Merged

ganey merged 1 commit into
SteamDatabase:masterfrom
ganey:fix/inventory-sell-dialog-guard

Conversation

@ganey

@ganey ganey commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Valve replaced the Prototype SellItemDialog with a React sell dialog, so window.SellItemDialog is now undefined on inventory pages. inventory.js read window.SellItemDialog.OnSuccess at load, threw, and never registered the RenderItemInfo hook. Everything after that point in the script was dead.

  • Skip the "no sell reload" hook when SellItemDialog doesn't exist.
  • Disable quick sell in the same case. Its button fills the old #market_sell_* inputs and calls SellItemDialog.OnAccept, so showing it would give a button that throws on click.

Quick sell and the no reload hook still need rewriting for the new React dialog. That is a separate change and needs the dialog's DOM, which isn't in the page source.

Tested in Chromium with the extension loaded, logged in, on /my/inventory/#753_6: the OnSuccess page error is gone and there are no [SteamDB] errors. The quick sell container is no longer rendered (expected for now). npm test passes.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@ganey
ganey merged commit 766c263 into SteamDatabase:master Dec 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant