Rewrite markers reducer in Typescript (#27644)

This commit is contained in:
Renaud Chaput authored and GitHub committed 2024-03-27 12:47:09 +00:00
1 parent d49343ed11
commit 27d014a7fa
9 files changed
+202 -185

No files matched your search

+7 -2
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 {};