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 some type errors #313

Merged
merged 1 commit into from
Aug 7, 2023
Merged

Fix some type errors #313

merged 1 commit into from
Aug 7, 2023

Conversation

lukaw3d
Copy link
Member

@lukaw3d lukaw3d commented Aug 7, 2023

No description provided.

@pro-wh
Copy link
Contributor

pro-wh commented Aug 7, 2023

does ci check these typings?

@lukaw3d
Copy link
Member Author

lukaw3d commented Aug 7, 2023

nope, there's hundreds more type errors. This just makes vscode less red

Copy link
Contributor

@pro-wh pro-wh left a comment

Choose a reason for hiding this comment

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

ok but I didn't verify all of these, such as the onSelect/onDelete and renderSendContent call signatures

Comment on lines 54 to 56
}
if (params && params.origin) {
queryParams.url = params.origin + "/*"
...(params && params.origin ? {
url: params.origin + "/*",
} : {})
Copy link
Contributor

Choose a reason for hiding this comment

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

can I say this one's too weird

Copy link
Member Author

@lukaw3d lukaw3d Aug 7, 2023

Choose a reason for hiding this comment

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

Yeah - it's just the only way of specifying conditional properties so that type can be inferred

Alternative:

        queryParams = {
          active: true,
          ...(params?.origin && {
            url: params.origin + "/*",
          })
        }

Copy link
Member Author

Choose a reason for hiding this comment

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

oh this one doesn't even need to be conditional. it works if it's undefined

        queryParams = {
          active: true,
          url: params?.origin ? params.origin + "/*" : undefined,
        }

@lukaw3d lukaw3d force-pushed the lw/fix-some-types branch from b0d307d to 1afa4f7 Compare August 7, 2023 23:38
@lukaw3d lukaw3d merged commit 2c02519 into master Aug 7, 2023
@lukaw3d lukaw3d deleted the lw/fix-some-types branch August 7, 2023 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants