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 Vue bool and timestamp #158

Merged
merged 1 commit into from
Nov 22, 2023
Merged

Conversation

ThetaSinner
Copy link
Member

Ran into these while testing another change. It looks like these types aren't covered by the automated tests, something that would be good to cover because these typescript errors prevent the app running

@ThetaSinner ThetaSinner added ShouldBackport/0.1 This change should be backported to develop-0.1 ShouldBackport/0.2 This change should be backported to develop-0.2 labels Nov 21, 2023
@@ -1 +1 @@
{{{{raw}}}} {{ {{{{/raw}}}} new Date({{variable_to_read}} / 1000).toLocaleString() {{{{raw}}}} }} {{{{/raw}}}}
{{{{raw}}}} {{ {{{{/raw}}}} {{variable_to_read}} ? new Date({{variable_to_read}} / 1000).toLocaleString() : 'Missing timestamp' {{{{raw}}}} }} {{{{/raw}}}}
Copy link
Member Author

Choose a reason for hiding this comment

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

Produces

<span style="white-space: pre-line">{{  jklh?.when ? new Date(jklh?.when / 1000).toLocaleString() : 'Missing timestamp' }} </span>

Instead of

<span style="white-space: pre-line">{{  new Date(jklh?.when / 1000).toLocaleString() }} </span>

Which is not valid TypeScript as you can't divide undefined by a number

@ThetaSinner ThetaSinner force-pushed the fix-vue-bool-and-timestamp branch from 0e7484f to 55c135a Compare November 21, 2023 13:47
Copy link
Collaborator

@guillemcordoba guillemcordoba left a comment

Choose a reason for hiding this comment

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

Awesome!

@ThetaSinner ThetaSinner force-pushed the fix-vue-bool-and-timestamp branch from 55c135a to 87db651 Compare November 21, 2023 14:39
@ThetaSinner ThetaSinner merged commit afcf66e into develop Nov 22, 2023
1 check passed
@ThetaSinner ThetaSinner deleted the fix-vue-bool-and-timestamp branch November 22, 2023 12:46
ThetaSinner added a commit that referenced this pull request Nov 28, 2023
ThetaSinner added a commit that referenced this pull request Nov 28, 2023
ThetaSinner added a commit that referenced this pull request Nov 28, 2023
@ThetaSinner ThetaSinner removed ShouldBackport/0.2 This change should be backported to develop-0.2 ShouldBackport/0.1 This change should be backported to develop-0.1 labels Nov 28, 2023
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