-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix explorer url #6
Conversation
WalkthroughThe updates involve URL adjustments in TypeScript constants, enhancements to a JavaScript store module with new functions and state management for network configurations, and workflow optimizations in GitHub Actions with Node.js and cache version upgrades, as well as specific tool version settings. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ? TipsChat with CodeRabbit Bot (
|
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
Visit the preview URL for this PR (updated for commit 3ad8f69): https://nibiru-explorer--pr6-fix-explorer-url-wfhlvrjt.web.app (expires Mon, 25 Dec 2023 15:14:26 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 0653a911498be5ff7b1517207d84ddca0bcce10b |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 13
Configuration used: CodeRabbit UI
Files selected for processing (2)
- src/nibiru/index.ts (1 hunks)
- src/store/chains/index.js (1 hunks)
Files skipped from review due to trivial changes (1)
- src/nibiru/index.ts
Additional comments: 1
src/store/chains/index.js (1)
- 151-154: The
TextEncoder
is used but not imported or defined. Ensure thatTextEncoder
is available in the runtime environment or import it explicitly.
src/store/chains/index.js
Outdated
try { | ||
const testnets = await fetch(ITN_NETWORKS).then(response => response.json()) | ||
testnets.forEach((_, i) => { | ||
testnets[i].visible = true | ||
}) | ||
configs.push(...testnets) | ||
} catch (error) { | ||
console.log(error) | ||
} | ||
|
||
try { | ||
const devnets = await fetch(DEV_NETWORKS).then(response => response.json()) | ||
devnets.forEach((_, i) => { | ||
devnets[i].visible = false | ||
}) | ||
configs.push(...devnets) | ||
} catch (error) { | ||
console.log(error) | ||
} | ||
|
||
try { | ||
const playnets = await fetch(PLAYGROUND_NETWORKS).then(response => response.json()) | ||
playnets.forEach((_, i) => { | ||
playnets[i].visible = false | ||
}) | ||
configs.push(...playnets) | ||
} catch (error) { | ||
console.log(error) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The await
keyword is used outside of an async
function, which will cause a syntax error. Wrap the code that uses await
with an async
function or use .then()
for promise handling.
src/store/chains/index.js
Outdated
}) | ||
configs.push(...testnets) | ||
} catch (error) { | ||
console.log(error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider improving error handling instead of just logging to the console. In a production environment, it's better to handle errors in a way that can be monitored or reported to an error tracking service.
Also applies to: 36-36, 46-46
src/store/chains/index.js
Outdated
}) | ||
|
||
chains = update | ||
localStorage.setItem('chains', JSON.stringify(update)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direct manipulation of localStorage
is found. Consider abstracting local storage access to handle potential key collisions and to make it easier to change storage keys in the future.
Also applies to: 93-93, 106-106
src/store/chains/index.js
Outdated
ibcPaths: {}, | ||
}, | ||
getters: { | ||
getchains: state => state.chains, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The getchains
getter is returning state.chains
, which is undefined. It should return state.config
based on the state definition.
- getchains: state => state.chains,
+ getchains: state => state.config,
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
getchains: state => state.chains, | |
getchains: state => state.config, |
src/store/chains/index.js
Outdated
setup_sdk_version(state, info) { | ||
state.chains.config[info.chain_name].sdk_version = info.version | ||
}, | ||
select(state, args) { | ||
state.chains.selected = state.chains.config[args.chain_name] | ||
}, | ||
cacheAvatar(state, args) { | ||
state.chains.avatars[args.identity] = args.url | ||
localStorage.setItem('avatars', JSON.stringify(state.chains.avatars)) | ||
}, | ||
setHeight(state, height) { | ||
state.chains.height = height | ||
}, | ||
setChannels(state, { chain, channels }) { | ||
state.chains.ibcChannels[chain] = channels | ||
}, | ||
setQuotes(state, quotes) { | ||
state.quotes = quotes | ||
}, | ||
setDefaultWallet(state, defaultWallet) { | ||
if (defaultWallet && defaultWallet.length > 0) { | ||
localStorage.setItem('default-wallet', defaultWallet) | ||
state.chains.defaultWallet = defaultWallet | ||
} else { | ||
state.chains.defaultWallet = null | ||
} | ||
}, | ||
setIBCDenoms(state, denoms) { | ||
state.denoms = { ...state.denoms, ...denoms } | ||
}, | ||
setIBCPaths(state, paths) { | ||
state.ibcPaths = paths | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mutations are referencing state.chains
, which is not defined in the state. It should be state.config
based on the state definition.
src/store/chains/index.js
Outdated
setDefaultWallet(state, defaultWallet) { | ||
if (defaultWallet && defaultWallet.length > 0) { | ||
localStorage.setItem('default-wallet', defaultWallet) | ||
state.chains.defaultWallet = defaultWallet | ||
} else { | ||
state.chains.defaultWallet = null | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setDefaultWallet
mutation is incorrectly updating state.chains.defaultWallet
. It should update state.defaultWallet
based on the state definition.
- state.chains.defaultWallet = defaultWallet
+ state.defaultWallet = defaultWallet
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
setDefaultWallet(state, defaultWallet) { | |
if (defaultWallet && defaultWallet.length > 0) { | |
localStorage.setItem('default-wallet', defaultWallet) | |
state.chains.defaultWallet = defaultWallet | |
} else { | |
state.chains.defaultWallet = null | |
} | |
setDefaultWallet(state, defaultWallet) { | |
if (defaultWallet && defaultWallet.length > 0) { | |
localStorage.setItem('default-wallet', defaultWallet) | |
state.defaultWallet = defaultWallet | |
} else { | |
state.defaultWallet = null | |
} |
src/store/chains/index.js
Outdated
setChannels(state, { chain, channels }) { | ||
state.chains.ibcChannels[chain] = channels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setChannels
mutation is incorrectly updating state.chains.ibcChannels
. It should update state.ibcChannels
based on the state definition.
- state.chains.ibcChannels[chain] = channels
+ state.ibcChannels[chain] = channels
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
setChannels(state, { chain, channels }) { | |
state.chains.ibcChannels[chain] = channels | |
setChannels(state, { chain, channels }) { | |
state.ibcChannels[chain] = channels |
src/store/chains/index.js
Outdated
cacheAvatar(state, args) { | ||
state.chains.avatars[args.identity] = args.url | ||
localStorage.setItem('avatars', JSON.stringify(state.chains.avatars)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cacheAvatar
mutation is incorrectly updating state.chains.avatars
. It should update state.avatars
based on the state definition.
- state.chains.avatars[args.identity] = args.url
+ state.avatars[args.identity] = args.url
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
cacheAvatar(state, args) { | |
state.chains.avatars[args.identity] = args.url | |
localStorage.setItem('avatars', JSON.stringify(state.chains.avatars)) | |
cacheAvatar(state, args) { | |
state.avatars[args.identity] = args.url | |
localStorage.setItem('avatars', JSON.stringify(state.chains.avatars)) |
src/store/chains/index.js
Outdated
select(state, args) { | ||
state.chains.selected = state.chains.config[args.chain_name] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The select
mutation is incorrectly updating state.chains.selected
. It should update state.selected
based on the state definition.
- state.chains.selected = state.chains.config[args.chain_name]
+ state.selected = state.config[args.chain_name]
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
select(state, args) { | |
state.chains.selected = state.chains.config[args.chain_name] | |
select(state, args) { | |
state.selected = state.config[args.chain_name] |
src/store/chains/index.js
Outdated
setup_sdk_version(state, info) { | ||
state.chains.config[info.chain_name].sdk_version = info.version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setup_sdk_version
mutation is incorrectly updating state.chains.config
. It should update state.config
based on the state definition.
- state.chains.config[info.chain_name].sdk_version = info.version
+ state.config[info.chain_name].sdk_version = info.version
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
setup_sdk_version(state, info) { | |
state.chains.config[info.chain_name].sdk_version = info.version | |
setup_sdk_version(state, info) { | |
state.config[info.chain_name].sdk_version = info.version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- .github/workflows/deploy-preview.yml (2 hunks)
- .github/workflows/deploy-prod.yml (2 hunks)
Additional comments: 5
.github/workflows/deploy-preview.yml (3)
11-15: The update to Node.js version 'lts/gallium' and the addition of 'yarn' cache are good practices for ensuring the build environment is up-to-date and dependencies are cached for faster builds. Ensure that 'lts/gallium' is compatible with the project's Node.js requirements.
26-33: Pinning the Firebase tools version to '12.9.1' is a good practice for maintaining consistent build environments. Verify that this version is compatible with the project's requirements and does not introduce any breaking changes.
28-29: Enclosing the
repoToken
andfirebaseServiceAccount
in single quotes is a minor syntax change that should not affect functionality, as long as the secrets are correctly set in the GitHub repository settings..github/workflows/deploy-prod.yml (2)
14-18: The update to Node.js version 'lts/gallium' and cache to 'yarn' is clear and should not affect any exported or public entities.
29-36: The syntax changes to use single quotes for
repoToken
andfirebaseServiceAccount
, and the pinning offirebaseToolsVersion
to '12.9.1' are appropriate and follow best practices for YAML files.
Updates URLs
Summary by CodeRabbit
New Features
Bug Fixes
Chores
Documentation