From 19d579c2a0a9c09d251ed18ef3c2f44b2b34be19 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 25 Apr 2022 15:47:47 -0500 Subject: [PATCH] createAsyncThunk(): .toString() --> .type --- .../__tests__/landing_page.test.tsx | 8 ++++---- .../reducers/__tests__/instance-test.js | Bin 3870 -> 3852 bytes app/soapbox/reducers/instance.ts | 8 ++++---- app/soapbox/reducers/meta.ts | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/app/soapbox/features/landing_page/__tests__/landing_page.test.tsx b/app/soapbox/features/landing_page/__tests__/landing_page.test.tsx index 7ec1010fa7..0b6396d5b0 100644 --- a/app/soapbox/features/landing_page/__tests__/landing_page.test.tsx +++ b/app/soapbox/features/landing_page/__tests__/landing_page.test.tsx @@ -9,7 +9,7 @@ describe('', () => { it('renders a RegistrationForm for an open Pleroma instance', () => { const state = rootReducer(undefined, { - type: rememberInstance.fulfilled.toString(), + type: rememberInstance.fulfilled.type, payload: { version: '2.7.2 (compatible; Pleroma 2.3.0)', registrations: true, @@ -26,7 +26,7 @@ describe('', () => { it('renders "closed" message for a closed Pleroma instance', () => { const state = rootReducer(undefined, { - type: rememberInstance.fulfilled.toString(), + type: rememberInstance.fulfilled.type, payload: { version: '2.7.2 (compatible; Pleroma 2.3.0)', registrations: false, @@ -43,7 +43,7 @@ describe('', () => { it('renders Pepe flow for an open Truth Social instance', () => { const state = applyActions(undefined, [{ - type: rememberInstance.fulfilled.toString(), + type: rememberInstance.fulfilled.type, payload: { version: '3.4.1 (compatible; TruthSocial 1.0.0)', registrations: false, @@ -65,7 +65,7 @@ describe('', () => { it('renders "closed" message for a Truth Social instance with Pepe closed', () => { const state = applyActions(undefined, [{ - type: rememberInstance.fulfilled.toString(), + type: rememberInstance.fulfilled.type, payload: { version: '3.4.1 (compatible; TruthSocial 1.0.0)', registrations: false, diff --git a/app/soapbox/reducers/__tests__/instance-test.js b/app/soapbox/reducers/__tests__/instance-test.js index e1e99bf07432d7030f129db947bcff4c0f05daa7..33a5fab55ed63f4678ed4be284c8451e940f92fd 100644 GIT binary patch delta 42 qcmbOy*CV&#Gc$8#LF(kWT!x!z>% diff --git a/app/soapbox/reducers/instance.ts b/app/soapbox/reducers/instance.ts index 16523d474f..db8ef816eb 100644 --- a/app/soapbox/reducers/instance.ts +++ b/app/soapbox/reducers/instance.ts @@ -114,14 +114,14 @@ export default function instance(state = initialState, action: AnyAction) { switch(action.type) { case PLEROMA_PRELOAD_IMPORT: return preloadImport(state, action, '/api/v1/instance'); - case rememberInstance.fulfilled.toString(): + case rememberInstance.fulfilled.type: return importInstance(state, ImmutableMap(fromJS(action.payload))); - case fetchInstance.fulfilled.toString(): + case fetchInstance.fulfilled.type: persistInstance(action.payload); return importInstance(state, ImmutableMap(fromJS(action.payload))); - case fetchInstance.rejected.toString(): + case fetchInstance.rejected.type: return handleInstanceFetchFail(state, action.error); - case fetchNodeinfo.fulfilled.toString(): + case fetchNodeinfo.fulfilled.type: return importNodeinfo(state, ImmutableMap(fromJS(action.payload))); case ADMIN_CONFIG_UPDATE_REQUEST: case ADMIN_CONFIG_UPDATE_SUCCESS: diff --git a/app/soapbox/reducers/meta.ts b/app/soapbox/reducers/meta.ts index 026b050b32..ce6848dfe6 100644 --- a/app/soapbox/reducers/meta.ts +++ b/app/soapbox/reducers/meta.ts @@ -12,7 +12,7 @@ const ReducerRecord = ImmutableRecord({ export default function meta(state = ReducerRecord(), action: AnyAction) { switch(action.type) { - case fetchInstance.rejected.toString(): + case fetchInstance.rejected.type: return state.set('instance_fetch_failed', true); default: return state;