Have /tint use the primary color as the secondary if no secondary was given

This is to make the color scheme actually apply itself now that the secondary color is not optional. In order to preserve it being optional in the command, we'll use the primary color as the secondary color as it has no major visual impact.

Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
Travis Ralston 2017-12-25 13:39:32 -07:00
parent 2815c576c1
commit e8392dfa00

View file

@ -96,6 +96,8 @@ const commands = {
colorScheme.primary_color = matches[1]; colorScheme.primary_color = matches[1];
if (matches[4]) { if (matches[4]) {
colorScheme.secondary_color = matches[4]; colorScheme.secondary_color = matches[4];
} else {
colorScheme.secondary_color = colorScheme.primary_color;
} }
return success( return success(
SettingsStore.setValue("roomColor", roomId, SettingLevel.ROOM_ACCOUNT, colorScheme), SettingsStore.setValue("roomColor", roomId, SettingLevel.ROOM_ACCOUNT, colorScheme),