mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-20 21:58:09 +00:00
Make React Spring respect animation preferences (#35018)
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import { createRoot } from 'react-dom/client';
|
||||
|
||||
import { Globals } from '@react-spring/web';
|
||||
|
||||
import { setupBrowserNotifications } from 'mastodon/actions/notifications';
|
||||
import Mastodon from 'mastodon/containers/mastodon';
|
||||
import { me } from 'mastodon/initial_state';
|
||||
import { me, reduceMotion } from 'mastodon/initial_state';
|
||||
import * as perf from 'mastodon/performance';
|
||||
import ready from 'mastodon/ready';
|
||||
import { store } from 'mastodon/store';
|
||||
@@ -21,6 +23,12 @@ function main() {
|
||||
mountNode.getAttribute('data-props') ?? '{}',
|
||||
) as Record<string, unknown>;
|
||||
|
||||
if (reduceMotion) {
|
||||
Globals.assign({
|
||||
skipAnimation: true,
|
||||
});
|
||||
}
|
||||
|
||||
const root = createRoot(mountNode);
|
||||
root.render(<Mastodon {...props} />);
|
||||
store.dispatch(setupBrowserNotifications());
|
||||
|
||||
Reference in New Issue
Block a user