From 5180895325803b3b05d34d7b5248e448b19a5277 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 21 Sep 2021 20:26:47 -0500 Subject: [PATCH] Preload: import accounts from Mastodon's initial-state --- app/soapbox/actions/preload.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/soapbox/actions/preload.js b/app/soapbox/actions/preload.js index 5d606c8ca..e136a7b35 100644 --- a/app/soapbox/actions/preload.js +++ b/app/soapbox/actions/preload.js @@ -1,4 +1,5 @@ import { mapValues } from 'lodash'; +import { importFetchedAccounts } from './importer'; export const PLEROMA_PRELOAD_IMPORT = 'PLEROMA_PRELOAD_IMPORT'; export const MASTODON_PRELOAD_IMPORT = 'MASTODON_PRELOAD_IMPORT'; @@ -50,8 +51,8 @@ export function preloadPleroma(data) { } export function preloadMastodon(data) { - return { - type: MASTODON_PRELOAD_IMPORT, - data, + return (dispatch, getState) => { + importFetchedAccounts(Object.values(data.accounts)); + dispatch({ type: MASTODON_PRELOAD_IMPORT, data }); }; }