Rewrite actions/app.ts and reducers/missed_updates.ts with createAction (#24801)

This commit is contained in:
fusagiko / takayamaki 2023-05-03 22:28:39 +09:00 committed by GitHub
parent c98b012583
commit 0999cb4601
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 45 additions and 42 deletions

View file

@ -1,5 +1,5 @@
import { STORE_HYDRATE } from 'mastodon/actions/store';
import { APP_LAYOUT_CHANGE } from 'mastodon/actions/app';
import { changeLayout } from 'mastodon/actions/app';
import { Map as ImmutableMap } from 'immutable';
import { layoutFromWindow } from 'mastodon/is_mobile';
@ -14,8 +14,8 @@ export default function meta(state = initialState, action) {
switch(action.type) {
case STORE_HYDRATE:
return state.merge(action.state.get('meta')).set('permissions', action.state.getIn(['role', 'permissions']));
case APP_LAYOUT_CHANGE:
return state.set('layout', action.layout);
case changeLayout.type:
return state.set('layout', action.payload.layout);
default:
return state;
}