From ebcc65dc7eafa4ab0d45558464f1cce65de9fb6f Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 12 Oct 2018 13:52:58 -0600 Subject: [PATCH] Apply the user's tint once the MatrixClientPeg is moderately ready Any earlier and we risk getting NPEs from the peg not existing. Fixes https://github.com/vector-im/riot-web/issues/6424 --- src/MatrixClientPeg.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index f02c751a2c..3fca482aba 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -26,6 +26,7 @@ import EventTimelineSet from 'matrix-js-sdk/lib/models/event-timeline-set'; import createMatrixClient from './utils/createMatrixClient'; import SettingsStore from './settings/SettingsStore'; import MatrixActionCreators from './actions/MatrixActionCreators'; +import Tinter from "./Tinter"; interface MatrixClientCreds { homeserverUrl: string, @@ -128,6 +129,9 @@ class MatrixClientPeg { opts.lazyLoadMembers = true; } + const color_scheme = SettingsStore.getValue("roomColor"); + Tinter.tint(color_scheme.primary_color, color_scheme.secondary_color); + // Connect the matrix client to the dispatcher MatrixActionCreators.start(this.matrixClient);