Skip to content

Commit 87a649a

Browse files
committed
added action back to callbacks
1 parent f6f8000 commit 87a649a

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

dash/dash-renderer/src/actions/callbacks.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import {isMultiValued, stringifyId, isMultiOutputProp} from './dependencies';
3030
import {urlBase} from './utils';
3131
import {getCSRFHeader} from '.';
3232
import {createAction, Action} from 'redux-actions';
33-
import {setConfigNoRefresh} from '../actions';
33+
import {addHttpHeaders} from '../actions';
3434

3535
export const addBlockedCallbacks = createAction<IBlockedCallback[]>(
3636
CallbackActionType.AddBlocked
@@ -519,7 +519,7 @@ export function executeCallback(
519519
}
520520

521521
let newConfig = config;
522-
let configChanged = false;
522+
let newHeaders: Record<string, string> | null = null;
523523
let retry = 0;
524524

525525
while (true) {
@@ -531,8 +531,8 @@ export function executeCallback(
531531
payload
532532
);
533533

534-
if (configChanged) {
535-
dispatch(setConfigNoRefresh(newConfig));
534+
if (newHeaders) {
535+
dispatch(addHttpHeaders(newHeaders));
536536
}
537537

538538
return {data, payload};
@@ -555,16 +555,16 @@ export function executeCallback(
555555
)
556556
);
557557
if (newJwt) {
558+
newHeaders = {
559+
Authorization: `Bearer ${newJwt}`
560+
};
561+
558562
newConfig = mergeDeepRight(config, {
559563
fetch: {
560-
headers: {
561-
Authorization: `Bearer ${newJwt}`
562-
}
564+
headers: newHeaders
563565
}
564566
});
565567

566-
configChanged = true;
567-
568568
continue;
569569
}
570570
}

0 commit comments

Comments
 (0)