Open
Conversation
| moduleNamespace = 'module-' + namespace, | ||
|
|
||
| $module = $(this), | ||
| $context = $(settings.context), |
Check warning
Code scanning / CodeQL
Unsafe jQuery plugin
| moduleNamespace = 'module-' + namespace, | ||
|
|
||
| $module = $(this), | ||
| $context = $(settings.context), |
Check warning
Code scanning / CodeQL
Unsafe jQuery plugin
|
|
||
| refresh: function() { | ||
| module.verbose('Refreshing selector cache'); | ||
| $context = $(settings.context); |
Check warning
Code scanning / CodeQL
Unsafe jQuery plugin
|
|
||
| $module = $(this), | ||
| $window = $(window), | ||
| $scroll = $(settings.scrollContext), |
Check warning
Code scanning / CodeQL
Unsafe jQuery plugin
Here's an explication what caused this error and later 2 possible solutions (first a bit hacky, second nicer and future proof). The `name-bazaar.ui.core/init` function was called (which in turn emitted the `:district0x/initialize` event (that resulted in the error due to `window.Web3Modal` not being present. It was also called 2 times: first one failed due to the previously mentioned reason. Second one works (because `window.Web3Modal` was there). So why 2 times? First time due to - https://github.com/district0x/name-bazaar/blob/ec1be3a4fbc4529b553b984aad1cda7e55217b71/shadow-cljs.edn#L4 - loaded at https://github.com/district0x/name-bazaar/blob/ec1be3a4fbc4529b553b984aad1cda7e55217b71/resources/public/index.html#L43 Second time due to explicit call of `name_bazaar.ui.core.init()` at https://github.com/district0x/name-bazaar/blob/ec1be3a4fbc4529b553b984aad1cda7e55217b71/resources/public/index.html#L48 The solution? 1. Make sure `web3modal` is loaded before calling `name_bazaar.ui.core.init()` 2. Also: remove the duplicity of calling `name_bazaar.ui.core.init()` twice Solution #1 (hacky): change the order of `<script>` tags so `web3modal` gets loaded before the name bazaar app (and its `ui.core.init` function gets executed. Solution #2 (better): this one doesn't pollute the global object (_window_). Basically loading `web3modal` via CLJS `ns` macro (ns xx `(:require ["web3modal" :as web3modal]))` and setting it up in the code Extra: remove the duplicity Basically removing manual call to https://github.com/district0x/name-bazaar/blob/ec1be3a4fbc4529b553b984aad1cda7e55217b71/resources/public/index.html#L48 and letting the shadow-cljs build execute once it's loaded. Again better because we don't know when `<script>` tag finishes loading
This reverts commit f9fe1e7.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.