Preload: import accounts from Mastodon's initial-state

This commit is contained in:
Alex Gleason 2021-09-21 20:26:47 -05:00
parent a8673c8e54
commit 5180895325
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
1 changed files with 4 additions and 3 deletions

View File

@ -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 });
}; };
} }