2
0
Fork 0

complete the merge

This commit is contained in:
ShittyKopper 2024-05-06 04:48:46 +03:00
commit c1a1050835
4 changed files with 17 additions and 17 deletions

View file

@ -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 {

View file

@ -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) => {