From 00f6df3f371dc21e902f51ad66b1ad1b5c4fc024 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 9 Jun 2022 14:29:01 -0500 Subject: [PATCH 1/4] Properly import quotes from reblogs --- app/soapbox/actions/importer/index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/soapbox/actions/importer/index.js b/app/soapbox/actions/importer/index.js index 9ad58e114..cb4305901 100644 --- a/app/soapbox/actions/importer/index.js +++ b/app/soapbox/actions/importer/index.js @@ -69,10 +69,21 @@ export function importFetchedStatus(status, idempotencyKey) { dispatch(importFetchedStatus(status.quote)); } + // Pleroma quotes if (status.pleroma?.quote?.id) { dispatch(importFetchedStatus(status.pleroma.quote)); } + // Fedibird quote from reblog + if (status.reblog?.quote?.id) { + dispatch(importFetchedStatus(status.reblog.quote)); + } + + // Pleroma quote from reblog + if (status.reblog?.pleroma?.quote?.id) { + dispatch(importFetchedStatus(status.reblog.pleroma.quote)); + } + if (status.poll?.id) { dispatch(importFetchedPoll(status.poll)); } From f5024d6c8e960399d065e22c0761e5bbaa0075e2 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 9 Jun 2022 14:59:27 -0500 Subject: [PATCH 2/4] Account lookup: fetch relationship --- app/soapbox/actions/accounts.js | 1 + 1 file changed, 1 insertion(+) diff --git a/app/soapbox/actions/accounts.js b/app/soapbox/actions/accounts.js index 0fbb5c1a5..5cc0008a4 100644 --- a/app/soapbox/actions/accounts.js +++ b/app/soapbox/actions/accounts.js @@ -176,6 +176,7 @@ export function fetchAccountByUsername(username, history) { }); } else if (features.accountLookup) { return dispatch(accountLookup(username)).then(account => { + dispatch(fetchRelationships([account.id])); dispatch(fetchAccountSuccess(account)); }).catch(error => { dispatch(fetchAccountFail(null, error)); From 28f0274b46ae379f9b783df5422d086a9633c0eb Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Thu, 9 Jun 2022 15:10:49 -0500 Subject: [PATCH 3/4] Fix actions/accounts test for accountLookup --- app/soapbox/actions/__tests__/accounts.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/soapbox/actions/__tests__/accounts.test.ts b/app/soapbox/actions/__tests__/accounts.test.ts index 3b1abbf9f..b02469527 100644 --- a/app/soapbox/actions/__tests__/accounts.test.ts +++ b/app/soapbox/actions/__tests__/accounts.test.ts @@ -264,7 +264,8 @@ describe('fetchAccountByUsername()', () => { }); expect(actions[1].type).toEqual('ACCOUNTS_IMPORT'); expect(actions[2].type).toEqual('ACCOUNT_LOOKUP_SUCCESS'); - expect(actions[3].type).toEqual('ACCOUNT_FETCH_SUCCESS'); + expect(actions[3].type).toEqual('RELATIONSHIPS_FETCH_REQUEST'); + expect(actions[4].type).toEqual('ACCOUNT_FETCH_SUCCESS'); }); }); From ecb3362ce2cf110c202b3998ff6857dbf889f861 Mon Sep 17 00:00:00 2001 From: Justin Date: Thu, 9 Jun 2022 16:44:49 -0400 Subject: [PATCH 4/4] Ensure whole number --- .../features/compose/components/polls/duration-selector.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/soapbox/features/compose/components/polls/duration-selector.tsx b/app/soapbox/features/compose/components/polls/duration-selector.tsx index 491530d22..10027824e 100644 --- a/app/soapbox/features/compose/components/polls/duration-selector.tsx +++ b/app/soapbox/features/compose/components/polls/duration-selector.tsx @@ -27,7 +27,7 @@ const DurationSelector = ({ onDurationChange }: IDurationSelector) => { now.setMinutes(now.getMinutes() + minutes); now.setHours(now.getHours() + hours); - return (now - future) / 1000; + return Math.round((now - future) / 1000); }, [days, hours, minutes]); useEffect(() => {