Commit 9220540
Fix trader crashes on object-form mods, make Find best return URL only (#5)
* Handle object-form mods from the trade API
The trade API migrated item mods from plain strings to objects carrying a
description and flags. Commit 2d09769 adapted explicitMods only, so any
item whose runeMods/enchantMods/implicitMods were populated crashed with
"attempt to call method 'gsub' (a nil value)" — escapeGGGString was handed
a table.
Use the same format-agnostic idiom already ported into ImportTab.lua, and
apply it to pseudoMods too, which crashed the same way one line later on
:match. That guard also fixes a pre-existing crash on an empty pseudoMods
array, which previously indexed nil rather than falling back to "0".
* Make "Find best" return the trade URL without listing items
Register the generated search so the short shareable link can be built,
then stop. The item listings are no longer fetched, parsed or sorted, so
the row stays on [Find best][url][Price Item] instead of flipping to the
result dropdown. "Price Item" remains available on that URL for when the
items are actually wanted.
The URL is set before the error branch so an empty search still yields a
link to loosen in the browser.
This orphans the Augment/Anoint Behaviour dropdowns in the Find best
dialog: their only consumer was the post-fetch item rewriting removed
here. Left in place rather than wired into "Price Item", which fires on
whatever URL is in the box and would rewrite hand-pasted results based on
a dropdown set during an unrelated search.
---------
Co-authored-by: oat <plokbowwork@gmail.com>1 parent 6f167ce commit 9220540
2 files changed
Lines changed: 27 additions & 66 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1022 | 1022 | | |
1023 | 1023 | | |
1024 | 1024 | | |
| 1025 | + | |
| 1026 | + | |
1025 | 1027 | | |
1026 | 1028 | | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
1062 | | - | |
1063 | | - | |
1064 | | - | |
1065 | | - | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
1081 | 1038 | | |
1082 | 1039 | | |
1083 | 1040 | | |
1084 | 1041 | | |
1085 | 1042 | | |
1086 | | - | |
| 1043 | + | |
| 1044 | + | |
1087 | 1045 | | |
1088 | | - | |
| 1046 | + | |
1089 | 1047 | | |
1090 | 1048 | | |
1091 | 1049 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
402 | | - | |
| 401 | + | |
| 402 | + | |
403 | 403 | | |
404 | | - | |
405 | | - | |
| 404 | + | |
| 405 | + | |
406 | 406 | | |
407 | | - | |
408 | | - | |
| 407 | + | |
| 408 | + | |
409 | 409 | | |
410 | | - | |
| 410 | + | |
411 | 411 | | |
412 | | - | |
| 412 | + | |
413 | 413 | | |
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
417 | | - | |
| 417 | + | |
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
| |||
428 | 428 | | |
429 | 429 | | |
430 | 430 | | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
431 | 434 | | |
432 | 435 | | |
433 | 436 | | |
434 | 437 | | |
435 | 438 | | |
436 | 439 | | |
437 | 440 | | |
438 | | - | |
| 441 | + | |
439 | 442 | | |
440 | 443 | | |
441 | 444 | | |
| |||
0 commit comments