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

De-dup theming code #11445

Merged
merged 2 commits into from
Nov 21, 2019
Merged

De-dup theming code #11445

merged 2 commits into from
Nov 21, 2019

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Nov 20, 2019

Following on from matrix-org/matrix-react-sdk#3637
this removes the code dealing with themes in vector/index.js and uses the
code from react-sdk. The two did almost exactly the same thing but in
subtley different ways.

This code can be incredibly subtle though, so doing this a separate
PR.

Based on #11442

dbkr added 2 commits November 20, 2019 13:43
A thesis presented in two parts. This part has the absolute minimum
logic changes to the themeing code in vector/index.js because I know
how subtle and fragile this code is. However, it also looks like it's
completely duplicated from react-sdk, so in the next part I'm going
to remove that logic and make it use the logic in react-sdk, then we
can see what breaks.

Requires matrix-org/matrix-react-sdk#3637
Following on from matrix-org/matrix-react-sdk#3637
this removes the code dealing with themes in vector/index.js and uses the
code from react-sdk. The two did almost exactly the same thing but in
subtley different ways.

This code can be incredibly subtle though, so doing this a separate
PR.
@dbkr dbkr requested a review from a team November 20, 2019 15:45
dbkr added a commit to matrix-org/matrix-react-sdk that referenced this pull request Nov 20, 2019
This was only used by vector/index.js, in the code removed by
element-hq/element-web#11445

React SDK does a very similar thing in setTheme but also gets the
rest of the custom theme name.

Requires element-hq/element-web#11445
@turt2live
Copy link
Member

I'm not sure it's safe to consider this code duplicated - the code is waiting for the CSS to load so it can set the theme without turning into a pile of no-css sadness.

@dbkr
Copy link
Member Author

dbkr commented Nov 20, 2019

Yep, but the code in setTheme attempts to do that too.

Copy link
Contributor

@bwindels bwindels left a comment

Choose a reason for hiding this comment

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

looks like theming stuff

@dbkr dbkr merged commit 8b2ca56 into develop Nov 21, 2019
@t3chguy t3chguy deleted the dbkr/dedup_theming_code branch May 12, 2022 09:06
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