Don't call fromJS in some reducers
This commit is contained in:
parent
8167b72762
commit
f1a286f5e0
|
@ -46,7 +46,7 @@ const minifyAccount = account => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const fixAccount = (state, account) => {
|
const fixAccount = (state, account) => {
|
||||||
const normalized = minifyAccount(normalizeAccount(fromJS(account)));
|
const normalized = minifyAccount(normalizeAccount(account));
|
||||||
return state.set(account.id, normalized);
|
return state.set(account.id, normalized);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ const removePermission = (state, accountIds, permissionGroup) => {
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const buildAccount = adminUser => normalizeAccount(fromJS({
|
const buildAccount = adminUser => normalizeAccount({
|
||||||
id: adminUser.get('id'),
|
id: adminUser.get('id'),
|
||||||
username: adminUser.get('nickname').split('@')[0],
|
username: adminUser.get('nickname').split('@')[0],
|
||||||
acct: adminUser.get('nickname'),
|
acct: adminUser.get('nickname'),
|
||||||
|
@ -142,7 +142,7 @@ const buildAccount = adminUser => normalizeAccount(fromJS({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
should_refetch: true,
|
should_refetch: true,
|
||||||
}));
|
});
|
||||||
|
|
||||||
const mergeAdminUser = (account, adminUser) => {
|
const mergeAdminUser = (account, adminUser) => {
|
||||||
return account.withMutations(account => {
|
return account.withMutations(account => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Map as ImmutableMap, fromJS } from 'immutable';
|
import { Map as ImmutableMap } from 'immutable';
|
||||||
|
|
||||||
import { POLLS_IMPORT } from 'soapbox/actions/importer';
|
import { POLLS_IMPORT } from 'soapbox/actions/importer';
|
||||||
import { normalizeStatus } from 'soapbox/normalizers/status';
|
import { normalizeStatus } from 'soapbox/normalizers/status';
|
||||||
|
@ -6,7 +6,7 @@ import { normalizeStatus } from 'soapbox/normalizers/status';
|
||||||
// HOTFIX: Convert the poll into a fake status to normalize it...
|
// HOTFIX: Convert the poll into a fake status to normalize it...
|
||||||
// TODO: get rid of POLLS_IMPORT and use STATUS_IMPORT here.
|
// TODO: get rid of POLLS_IMPORT and use STATUS_IMPORT here.
|
||||||
const normalizePoll = poll => {
|
const normalizePoll = poll => {
|
||||||
const status = fromJS({ poll });
|
const status = { poll };
|
||||||
return normalizeStatus(status).poll;
|
return normalizeStatus(status).poll;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue