diff --git a/patches/patches.json b/patches/patches.json index 9428153a8a..31d2d97811 100644 --- a/patches/patches.json +++ b/patches/patches.json @@ -202,5 +202,13 @@ "files": [ "src/stores/RoomViewStore.tsx" ] - } -} \ No newline at end of file + }, + "room-avatars-default-colors": { + "github-issue": "https://github.com/tchapgouv/tchap-web-v4/issues/282", + "package": "matrix-react-sdk", + "files": [ + "src/Avatar.ts" + ] + } + +} diff --git a/patches/room-avatars-default-colors/matrix-react-sdk+3.69.1.patch b/patches/room-avatars-default-colors/matrix-react-sdk+3.69.1.patch new file mode 100644 index 0000000000..124525bd3d --- /dev/null +++ b/patches/room-avatars-default-colors/matrix-react-sdk+3.69.1.patch @@ -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) {