complete the merge
This commit is contained in:
parent
acf03b3841
commit
c1a1050835
4 changed files with 17 additions and 17 deletions
|
|
@ -47,6 +47,11 @@ const authorizationHeaderFromState = (getState?: GetState) => {
|
|||
} as RawAxiosRequestHeaders;
|
||||
};
|
||||
|
||||
const baseUrlFromState = (getState?: GetState) => {
|
||||
const baseUrl = getState && getState().meta.get('base_url');
|
||||
return `${baseUrl}`;
|
||||
};
|
||||
|
||||
// eslint-disable-next-line import/no-default-export
|
||||
export default function api(getState: GetState) {
|
||||
return axios.create({
|
||||
|
|
@ -55,6 +60,8 @@ export default function api(getState: GetState) {
|
|||
...authorizationHeaderFromState(getState),
|
||||
},
|
||||
|
||||
baseURL: baseUrlFromState(getState),
|
||||
|
||||
transformResponse: [
|
||||
function (data: unknown) {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ type LocationState = MastodonLocationState | null | undefined;
|
|||
type HistoryPath = Path | LocationDescriptor<LocationState>;
|
||||
|
||||
const browserHistory = createBrowserHistory<LocationState>();
|
||||
const originalPush = browserHistory.push.bind(browserHistory);
|
||||
const originalReplace = browserHistory.replace.bind(browserHistory);
|
||||
|
||||
export function useAppHistory() {
|
||||
|
|
@ -49,11 +48,7 @@ function normalizePath(
|
|||
);
|
||||
}
|
||||
|
||||
if (layoutFromWindow() === 'multi-column' && !path.startsWith('/deck')) {
|
||||
originalPush(`/deck${path}`, state);
|
||||
} else {
|
||||
originalPush(path, state);
|
||||
}
|
||||
return location;
|
||||
}
|
||||
|
||||
browserHistory.replace = (path: HistoryPath, state?: MastodonLocationState) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue