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

Alerter: handle case of no alerts #530

Closed
wants to merge 1 commit into from

Conversation

Williangalvani
Copy link
Member

fixes some errors I've seen when testing on my Quest 3

@Williangalvani Williangalvani marked this pull request as draft October 24, 2023 04:43
@@ -47,7 +47,7 @@ const alertPersistencyInterval = 10 // in seconds

const formattedDate = (datetime: Date): string => format(datetime, 'HH:mm:ss')

const currentAlert = ref(alertStore.alerts[0])
const currentAlert = ref(alertStore.alerts?.[0] ?? undefined)
Copy link
Member

Choose a reason for hiding this comment

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

You don't need to return undefined, optional chaining already returns that.

Copy link
Member

@rafaellehmkuhl rafaellehmkuhl left a comment

Choose a reason for hiding this comment

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

Curiosity: when does this edge case happen? I ask because the alerts store already starts with the default "Cockpit started" alert, no it shouldn't ever be empty.

@rafaellehmkuhl
Copy link
Member

rafaellehmkuhl commented Nov 7, 2023

@Williangalvani is this PR appearing as close to you?
And does it appears as if I closed it?
It's appearing here as if I had closed the PR, but I did not.
And the button to reopen it also does not appear.

image

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.

3 participants