Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

New context for local device verification #12417

Merged
merged 3 commits into from
Apr 16, 2024

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Apr 12, 2024

We've decided we want to show some UTD errors differently depending on whether our device has been verified. That's fiddly, because determining if the device is verified is an async operation, and it can be updated independently of the events.

Rather than add state variables and event callbacks to every single UTD event tile, I want to expose this as a Context for use by all event tiles. This, therefore, is some enabling work to expose the verification status as a context.

part of element-hq/element-meta#2313

@richvdh richvdh requested a review from a team as a code owner April 12, 2024 14:15
@richvdh richvdh added the T-Task Refactoring, enabling or disabling functionality, other engineering tasks label Apr 12, 2024
Copy link
Contributor

@florianduros florianduros left a comment

Choose a reason for hiding this comment

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

Looks good

Comment on lines 86 to 92
interface Props {
/** Matrix client, which is exposed to all child components via {@link MatrixClientContext}. */
client: MatrixClient;

/** Child components which will receive the contexts */
children: ReactNode;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
interface Props {
/** Matrix client, which is exposed to all child components via {@link MatrixClientContext}. */
client: MatrixClient;
/** Child components which will receive the contexts */
children: ReactNode;
}
interface Props extends PropsWithChildren<{
/** Matrix client, which is exposed to all child components via {@link MatrixClientContext}. */
client: MatrixClient;
}>

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the suggestion! I've gone with something slightly different (removing children from Props, and using PropsWithChildren<Props> at the reference site) which I think is in the spirit of your suggestion and follows conventions elsewhere in the code.

@richvdh richvdh added this pull request to the merge queue Apr 16, 2024
Merged via the queue into develop with commit 5ed68ef Apr 16, 2024
22 checks passed
@richvdh richvdh deleted the rav/historical_events/02_local_verified_context branch April 16, 2024 10:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, enabling or disabling functionality, other engineering tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants