danreeves / dt-exchange

39 stars 18 forks source link

Display Bug in Chrome Extension #70

Closed isaac-j-smith closed 1 year ago

isaac-j-smith commented 1 year ago

I am encountering a display bug following the 'Tools of War' patch released 03/23/23. When loading https://accounts.atoma.cloud/dashboard, the tool crashes on the ++ Vendor Mounting ++ stage. Briefly looking through the repo, I believe it could be related to the new content giving unexpected values for mapping in src/localization.json

Error Code:

bundle.js:33468 Uncaught TypeError: Cannot read properties of undefined (reading 'display_name')
    at bundle.js:33468:147
    at Array.map (<anonymous>)
    at Store (bundle.js:33457:95)
    at renderWithHooks (bundle.js:20036:28)
    at updateFunctionComponent (bundle.js:22424:30)
    at beginWork (bundle.js:23730:24)
    at HTMLUnknownElement.callCallback2 (bundle.js:11848:24)
    at Object.invokeGuardedCallbackDev (bundle.js:11873:26)
    at invokeGuardedCallback (bundle.js:11907:41)
    at beginWork$1 (bundle.js:27533:17)

bundle.js:21890 The above error occurred in the <Store> component:
    at Store (chrome-extension://hcjihmkcnjkfkaeebhnpjcnnibpoolgc/bundle.js:33417:5)
    at Layout (chrome-extension://hcjihmkcnjkfkaeebhnpjcnnibpoolgc/bundle.js:34616:19)
    at SWRConfig (chrome-extension://hcjihmkcnjkfkaeebhnpjcnnibpoolgc/bundle.js:29733:13)
    at App

Consider adding an error boundary to your tree to customize error handling behavior.
Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.

logCapturedError @ bundle.js:21890

bundle.js:17059 Uncaught TypeError: Cannot read properties of undefined (reading 'display_name')
    at bundle.js:33468:147
    at Array.map (<anonymous>)
    at Store (bundle.js:33457:95)
    at renderWithHooks (bundle.js:20036:28)
    at updateFunctionComponent (bundle.js:22424:30)
    at beginWork (bundle.js:23730:24)
    at beginWork$1 (bundle.js:27521:24)
    at performUnitOfWork (bundle.js:26969:22)
    at workLoopSync (bundle.js:26905:15)
    at renderRootSync (bundle.js:26884:17)

bundle.js:33468:147:

/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Title, { style: filterMatchStyle, children: localisation_default[offer.description.id].display_name }),
daniel-r-jackson commented 1 year ago

I've confirmed this is due to an issue with the localisation.json not including the new items. You can get around this by not attempting to pull in the friendly display_name building the offers. I created a simple patch if you want to build the extension yourself as a band-aid fix: https://github.com/PlatinumOtter/dt-exchange/tree/bugfix/dj-handle-localisation-missing

brainsik commented 1 year ago

It seems clear from the comments here, but just in case: this is also happening in Firefox.

Sunderbraze commented 1 year ago

Pull request should fix: https://github.com/danreeves/dt-exchange/pull/72 Adapted the change to my ACS fork: https://github.com/Sunderbraze/dt-exchange It's available now on Firefox as 1.4.3 if anyone needs a temporary alternative until main gets updated: https://addons.mozilla.org/en-US/firefox/addon/armoury-exchange-acs/

danreeves commented 1 year ago

1.4.3 is now live on Firefox Chrome takes at least 24 hours to approve updates so that's out of my hands

danreeves commented 1 year ago

@Sunderbraze PRs welcome if you have feature ideas!

brainsik commented 1 year ago

Thanks for the quick fix for this @danreeves! 🖤