createAsyncThunk(): .toString() --> .type
This commit is contained in:
parent
928cf90c8f
commit
19d579c2a0
4 changed files with 9 additions and 9 deletions
|
@ -9,7 +9,7 @@ describe('<LandingPage />', () => {
|
|||
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('<LandingPage />', () => {
|
|||
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('<LandingPage />', () => {
|
|||
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('<LandingPage />', () => {
|
|||
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,
|
||||
|
|
Binary file not shown.
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue