[bugfix] account for data structure change in instance API fallback (#63)
Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/63 Co-authored-by: Sqx. Flann <fl4nn+codeberg@opensuse.org> Co-committed-by: Sqx. Flann <fl4nn+codeberg@opensuse.org>
This commit is contained in:
@@ -29,7 +29,7 @@ export const fetchServer = () => (dispatch, getState) => {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
api(getState)
|
api(getState)
|
||||||
.get('/api/v1/instance').then(({ data }) => {
|
.get('/api/v1/instance').then(({ data }) => {
|
||||||
if (data.contact.account) dispatch(importFetchedAccount(data.contact.account));
|
if (data.contact_account) dispatch(importFetchedAccount(data.contact_account));
|
||||||
dispatch(fetchServerSuccess(data));
|
dispatch(fetchServerSuccess(data));
|
||||||
}).catch(err => dispatch(fetchServerFail(err)));
|
}).catch(err => dispatch(fetchServerFail(err)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export const fetchServer = () => (dispatch, getState) => {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
api(getState)
|
api(getState)
|
||||||
.get('/api/v1/instance').then(({ data }) => {
|
.get('/api/v1/instance').then(({ data }) => {
|
||||||
if (data.contact.account) dispatch(importFetchedAccount(data.contact.account));
|
if (data.contact_account) dispatch(importFetchedAccount(data.contact_account));
|
||||||
dispatch(fetchServerSuccess(data));
|
dispatch(fetchServerSuccess(data));
|
||||||
}).catch(err => dispatch(fetchServerFail(err)));
|
}).catch(err => dispatch(fetchServerFail(err)));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user