Revert lazy type changes to actions/instance.ts
This commit is contained in:
parent
a773c245e8
commit
161cd3d1fc
1 changed files with 3 additions and 5 deletions
|
@ -59,7 +59,7 @@ export function fetchInstance() {
|
|||
return api(getState).get('/api/v1/instance').then(({ data: instance }: { data: Record<string, any> }) => {
|
||||
dispatch({ type: INSTANCE_FETCH_SUCCESS, instance });
|
||||
if (needsNodeinfo(instance)) {
|
||||
dispatch(fetchNodeinfo() as any); // Pleroma < 2.1 backwards compatibility
|
||||
dispatch(fetchNodeinfo()); // Pleroma < 2.1 backwards compatibility
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error(error);
|
||||
|
@ -73,10 +73,8 @@ export function loadInstance() {
|
|||
return (dispatch: AppDispatch, getState: () => RootState) => {
|
||||
const host = getHost(getState());
|
||||
|
||||
if (!host) return new Promise(r => r(null));
|
||||
|
||||
return dispatch(rememberInstance(host) as any).finally(() => {
|
||||
return dispatch(fetchInstance() as any);
|
||||
return dispatch(rememberInstance(host)).finally(() => {
|
||||
return dispatch(fetchInstance());
|
||||
});
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue