Skip to content
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 get solidity version for udapp docs #4841

Merged
merged 13 commits into from
Jun 12, 2024
Merged

Conversation

joeizang
Copy link
Collaborator

@joeizang joeizang commented Jun 4, 2024

fixes #4834

@joeizang joeizang added the ready-to-review PR ready to review label Jun 4, 2024
@joeizang joeizang self-assigned this Jun 4, 2024
Copy link

netlify bot commented Jun 4, 2024

Deploy Preview for remixproject ready!

Name Link
🔨 Latest commit 038ef7f
🔍 Latest deploy log https://app.netlify.com/sites/remixproject/deploys/66695f9fcfc91a0008902eb2
😎 Deploy Preview https://deploy-preview-4841--remixproject.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@@ -32,6 +32,22 @@ export function ContractGUI(props: ContractGUIProps) {
const initializeFields = useRef<Array<HTMLInputElement | null>>([])
const basicInputRef = useRef<HTMLInputElement>()
const intl = useIntl()
// const [solcVersion, setSolcVersion] = useState({ version: '', canReceive: true })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

const getVersion = () => window.location.href.split('=')[5].split('+')[0].split('-')[1]

// const [solcVersion, setSolcVersion] = useState({ version: '', canReceive: true })

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

const getVersion = () => {
let version = ''
try {
version = window.location.href.split('=')[5].split('+')[0].split('-')[1].slice(1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source of issue was this code. When there is no version in URL params, this throws. Better to check if version is available before splitting again

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using null coalescing to make sure that there is a default compiler selected. Hope this is agreeable

@@ -299,8 +299,8 @@ export function ContractGUI(props: ContractGUIProps) {
<div className="d-flex p-0 wrapperElement" onClick={handleActionClick} data-id={buttonOptions.dataId} data-title={buttonOptions.title}>
<button
className={`udapp_instanceButton text-nowrap overflow-hidden text-truncate ${props.widthClass} btn btn-sm ${buttonOptions.classList}`}
data-id={buttonOptions.dataId}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these needed? "firstbullseye" and "bullseye"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@joeizang joeizang merged commit eefc40a into master Jun 12, 2024
32 checks passed
@joeizang joeizang deleted the get-solidity-version-patch branch June 12, 2024 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-review PR ready to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve getting solidity version
3 participants