Revert lazy type changes to actions/instance.ts

virtualized-window
Alex Gleason 2022-03-24 11:09:30 -05:00
rodzic a773c245e8
commit 161cd3d1fc
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 3 dodań i 5 usunięć

Wyświetl plik

@ -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());
});
};
}