From 73e4d00cc2462349b93f2e994dcccf102f078c40 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Wed, 13 Oct 2021 15:10:26 -0500 Subject: [PATCH] ProfileMediaPanel: fix crash from syncronous noOp --- app/soapbox/actions/timelines.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/soapbox/actions/timelines.js b/app/soapbox/actions/timelines.js index 0ae23a0ed..934c52b00 100644 --- a/app/soapbox/actions/timelines.js +++ b/app/soapbox/actions/timelines.js @@ -124,6 +124,7 @@ export function clearTimeline(timeline) { } const noOp = () => {}; +const noOpAsync = () => () => new Promise(f => f()); const parseTags = (tags = {}, mode) => { return (tags[mode] || []).map((tag) => { @@ -138,7 +139,7 @@ export function expandTimeline(timelineId, path, params = {}, done = noOp) { if (timeline.get('isLoading')) { done(); - return dispatch(noOp); + return dispatch(noOpAsync()); } if (!params.max_id && !params.pinned && timeline.get('items', ImmutableOrderedSet()).size > 0) {