-
Notifications
You must be signed in to change notification settings - Fork 16
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
Fix some type errors #313
Conversation
does ci check these typings? |
nope, there's hundreds more type errors. This just makes vscode less red |
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.
ok but I didn't verify all of these, such as the onSelect/onDelete and renderSendContent call signatures
src/utils/commonMsg.js
Outdated
} | ||
if (params && params.origin) { | ||
queryParams.url = params.origin + "/*" | ||
...(params && params.origin ? { | ||
url: params.origin + "/*", | ||
} : {}) |
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.
can I say this one's too weird
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.
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 + "/*",
})
}
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.
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,
}
b0d307d
to
1afa4f7
Compare
No description provided.