-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #534 from tchapgouv/task/fix-room-avatars-default-…
…colors Room avatars take default colors
- Loading branch information
Showing
2 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
patches/room-avatars-default-colors/matrix-react-sdk+3.69.1.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/node_modules/matrix-react-sdk/src/Avatar.ts b/node_modules/matrix-react-sdk/src/Avatar.ts | ||
index 88c80ef..a023ba0 100644 | ||
--- a/node_modules/matrix-react-sdk/src/Avatar.ts | ||
+++ b/node_modules/matrix-react-sdk/src/Avatar.ts | ||
@@ -96,7 +96,7 @@ export function defaultAvatarUrlForString(s: string): string { | ||
const colorIndex = total % defaultColors.length; | ||
// overwritten color value in custom themes | ||
const cssVariable = `--avatar-background-colors_${colorIndex}`; | ||
- const cssValue = document.body.style.getPropertyValue(cssVariable); | ||
+ const cssValue = getComputedStyle(document.body).getPropertyValue(cssVariable); | ||
const color = cssValue || defaultColors[colorIndex]; | ||
let dataUrl = colorToDataURLCache.get(color); | ||
if (!dataUrl) { |