createAsyncThunk(): .toString() --> .type

This commit is contained in:
Alex Gleason 2022-04-25 15:47:47 -05:00
parent 928cf90c8f
commit 19d579c2a0
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
4 changed files with 9 additions and 9 deletions

View file

@ -9,7 +9,7 @@ describe('<LandingPage />', () => {
it('renders a RegistrationForm for an open Pleroma instance', () => { it('renders a RegistrationForm for an open Pleroma instance', () => {
const state = rootReducer(undefined, { const state = rootReducer(undefined, {
type: rememberInstance.fulfilled.toString(), type: rememberInstance.fulfilled.type,
payload: { payload: {
version: '2.7.2 (compatible; Pleroma 2.3.0)', version: '2.7.2 (compatible; Pleroma 2.3.0)',
registrations: true, registrations: true,
@ -26,7 +26,7 @@ describe('<LandingPage />', () => {
it('renders "closed" message for a closed Pleroma instance', () => { it('renders "closed" message for a closed Pleroma instance', () => {
const state = rootReducer(undefined, { const state = rootReducer(undefined, {
type: rememberInstance.fulfilled.toString(), type: rememberInstance.fulfilled.type,
payload: { payload: {
version: '2.7.2 (compatible; Pleroma 2.3.0)', version: '2.7.2 (compatible; Pleroma 2.3.0)',
registrations: false, registrations: false,
@ -43,7 +43,7 @@ describe('<LandingPage />', () => {
it('renders Pepe flow for an open Truth Social instance', () => { it('renders Pepe flow for an open Truth Social instance', () => {
const state = applyActions(undefined, [{ const state = applyActions(undefined, [{
type: rememberInstance.fulfilled.toString(), type: rememberInstance.fulfilled.type,
payload: { payload: {
version: '3.4.1 (compatible; TruthSocial 1.0.0)', version: '3.4.1 (compatible; TruthSocial 1.0.0)',
registrations: false, registrations: false,
@ -65,7 +65,7 @@ describe('<LandingPage />', () => {
it('renders "closed" message for a Truth Social instance with Pepe closed', () => { it('renders "closed" message for a Truth Social instance with Pepe closed', () => {
const state = applyActions(undefined, [{ const state = applyActions(undefined, [{
type: rememberInstance.fulfilled.toString(), type: rememberInstance.fulfilled.type,
payload: { payload: {
version: '3.4.1 (compatible; TruthSocial 1.0.0)', version: '3.4.1 (compatible; TruthSocial 1.0.0)',
registrations: false, registrations: false,

View file

@ -114,14 +114,14 @@ export default function instance(state = initialState, action: AnyAction) {
switch(action.type) { switch(action.type) {
case PLEROMA_PRELOAD_IMPORT: case PLEROMA_PRELOAD_IMPORT:
return preloadImport(state, action, '/api/v1/instance'); return preloadImport(state, action, '/api/v1/instance');
case rememberInstance.fulfilled.toString(): case rememberInstance.fulfilled.type:
return importInstance(state, ImmutableMap(fromJS(action.payload))); return importInstance(state, ImmutableMap(fromJS(action.payload)));
case fetchInstance.fulfilled.toString(): case fetchInstance.fulfilled.type:
persistInstance(action.payload); persistInstance(action.payload);
return importInstance(state, ImmutableMap(fromJS(action.payload))); return importInstance(state, ImmutableMap(fromJS(action.payload)));
case fetchInstance.rejected.toString(): case fetchInstance.rejected.type:
return handleInstanceFetchFail(state, action.error); return handleInstanceFetchFail(state, action.error);
case fetchNodeinfo.fulfilled.toString(): case fetchNodeinfo.fulfilled.type:
return importNodeinfo(state, ImmutableMap(fromJS(action.payload))); return importNodeinfo(state, ImmutableMap(fromJS(action.payload)));
case ADMIN_CONFIG_UPDATE_REQUEST: case ADMIN_CONFIG_UPDATE_REQUEST:
case ADMIN_CONFIG_UPDATE_SUCCESS: case ADMIN_CONFIG_UPDATE_SUCCESS:

View file

@ -12,7 +12,7 @@ const ReducerRecord = ImmutableRecord({
export default function meta(state = ReducerRecord(), action: AnyAction) { export default function meta(state = ReducerRecord(), action: AnyAction) {
switch(action.type) { switch(action.type) {
case fetchInstance.rejected.toString(): case fetchInstance.rejected.type:
return state.set('instance_fetch_failed', true); return state.set('instance_fetch_failed', true);
default: default:
return state; return state;