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
This commit is contained in:
Travis Ralston 2018-10-12 13:52:58 -06:00
parent 5085fd17a0
commit ebcc65dc7e

View file

@ -26,6 +26,7 @@ import EventTimelineSet from 'matrix-js-sdk/lib/models/event-timeline-set';
import createMatrixClient from './utils/createMatrixClient'; import createMatrixClient from './utils/createMatrixClient';
import SettingsStore from './settings/SettingsStore'; import SettingsStore from './settings/SettingsStore';
import MatrixActionCreators from './actions/MatrixActionCreators'; import MatrixActionCreators from './actions/MatrixActionCreators';
import Tinter from "./Tinter";
interface MatrixClientCreds { interface MatrixClientCreds {
homeserverUrl: string, homeserverUrl: string,
@ -128,6 +129,9 @@ class MatrixClientPeg {
opts.lazyLoadMembers = true; 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 // Connect the matrix client to the dispatcher
MatrixActionCreators.start(this.matrixClient); MatrixActionCreators.start(this.matrixClient);