Preload: import accounts from Mastodon's initial-state
This commit is contained in:
parent
a8673c8e54
commit
5180895325
|
@ -1,4 +1,5 @@
|
||||||
import { mapValues } from 'lodash';
|
import { mapValues } from 'lodash';
|
||||||
|
import { importFetchedAccounts } from './importer';
|
||||||
|
|
||||||
export const PLEROMA_PRELOAD_IMPORT = 'PLEROMA_PRELOAD_IMPORT';
|
export const PLEROMA_PRELOAD_IMPORT = 'PLEROMA_PRELOAD_IMPORT';
|
||||||
export const MASTODON_PRELOAD_IMPORT = 'MASTODON_PRELOAD_IMPORT';
|
export const MASTODON_PRELOAD_IMPORT = 'MASTODON_PRELOAD_IMPORT';
|
||||||
|
@ -50,8 +51,8 @@ export function preloadPleroma(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function preloadMastodon(data) {
|
export function preloadMastodon(data) {
|
||||||
return {
|
return (dispatch, getState) => {
|
||||||
type: MASTODON_PRELOAD_IMPORT,
|
importFetchedAccounts(Object.values(data.accounts));
|
||||||
data,
|
dispatch({ type: MASTODON_PRELOAD_IMPORT, data });
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue