Disable chat effects when reduce motion preferred

Some users prefer reduced motion, so this disables chat effects when such a
preference is set in the browser or OS.
This commit is contained in:
J. Ryan Stinnett 2021-02-17 17:43:31 +00:00
parent d643f06ff0
commit 10e25f306f
2 changed files with 47 additions and 0 deletions

View file

@ -37,6 +37,7 @@ import UIFeatureController from "./controllers/UIFeatureController";
import { UIFeature } from "./UIFeature";
import { OrderedMultiController } from "./controllers/OrderedMultiController";
import {Layout} from "./Layout";
import ReducedMotionController from './controllers/ReducedMotionController';
// These are just a bunch of helper arrays to avoid copy/pasting a bunch of times
const LEVELS_ROOM_SETTINGS = [
@ -652,6 +653,7 @@ export const SETTINGS: {[setting: string]: ISetting} = {
supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td("Show chat effects (animations when receiving e.g. confetti)"),
default: true,
controller: new ReducedMotionController(),
},
"Widgets.pinned": { // deprecated
supportedLevels: LEVELS_ROOM_OR_ACCOUNT,