Rewrite markers reducer in Typescript (#27644)

This commit is contained in:
Renaud Chaput 2024-03-27 13:47:09 +01:00 committed by GitHub
parent d49343ed11
commit 27d014a7fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 202 additions and 185 deletions

View file

@ -29,9 +29,14 @@ const setCSRFHeader = () => {
void ready(setCSRFHeader);
export const authorizationTokenFromState = (getState?: GetState) => {
return (
getState && (getState().meta.get('access_token', '') as string | false)
);
};
const authorizationHeaderFromState = (getState?: GetState) => {
const accessToken =
getState && (getState().meta.get('access_token', '') as string);
const accessToken = authorizationTokenFromState(getState);
if (!accessToken) {
return {};