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

Typescriptize MainHeader component #4535

Merged

Conversation

magicznyleszek
Copy link
Member

@magicznyleszek magicznyleszek commented Jul 10, 2023

Description

Internal code improvements.

Code Review Notes

I had to simplify it a bit, but didn't want to go full refactor on it. I need this to be TS for some other work. Since it's not a small change, I'm not entirely sure I want it merged into feature/my-projects, but still want it reviewed. The plan would be to wait for the feature to be merged (soon 🤞), and then change base of this PR to the other feature branch I'm working on.

@@ -269,40 +270,40 @@ export function isAssetPublic(permissions?: Permission[]) {
* For getting the icon class name for given asset type. Returned string always
* contains two class names: base `k-icon` and respective CSS class name.
Copy link
Contributor

@p2edwards p2edwards Jul 11, 2023

Choose a reason for hiding this comment

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

Is this comment still accurate?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated the comment :)

if (sessionStore.currentAccount?.git_rev) {
if (
'git_rev' in sessionStore.currentAccount &&
sessionStore.currentAccount?.git_rev
Copy link
Contributor

@p2edwards p2edwards Jul 11, 2023

Choose a reason for hiding this comment

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

I don't fully understand the 2nd check — 'git_rev' in sessionStore.currentAccount would throw an error if sessionStore.currentAccount isn't an object

Copy link
Member Author

Choose a reason for hiding this comment

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

Right, I've changed it to check if both of the values we use for rendering are strings.

@magicznyleszek magicznyleszek merged commit 66e27c9 into feature/my-projects Aug 4, 2023
3 of 4 checks passed
@magicznyleszek magicznyleszek deleted the typescriptize-main-header-component branch August 4, 2023 09:01
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.

None yet

2 participants