Merge pull request #10982 from BerkeleyTrue/fix/code-storage-fresh-head-tail
Fix(code-storage): Make sure head/tail is always fresh
This commit is contained in:
@@ -14,6 +14,9 @@ import {
|
||||
updateMain,
|
||||
lockUntrustedCode
|
||||
} from '../../common/app/routes/challenges/redux/actions';
|
||||
import {
|
||||
challengeSelector
|
||||
} from '../../common/app/routes/challenges/redux/selectors';
|
||||
|
||||
const legacyPrefixes = [
|
||||
'Bonfire: ',
|
||||
@@ -72,13 +75,14 @@ export function saveCodeSaga(actions, getState) {
|
||||
});
|
||||
}
|
||||
|
||||
export function loadCodeSaga(actions$, getState, { window, location }) {
|
||||
return actions$
|
||||
export function loadCodeSaga(actions, getState, { window, location }) {
|
||||
return actions
|
||||
::ofType(types.loadCode)
|
||||
.flatMap(() => {
|
||||
let finalFiles;
|
||||
const state = getState();
|
||||
const { user } = userSelector(state);
|
||||
const { challenge } = challengeSelector(state);
|
||||
const {
|
||||
challengesApp: {
|
||||
id = '',
|
||||
@@ -99,7 +103,7 @@ export function loadCodeSaga(actions$, getState, { window, location }) {
|
||||
makeToast({
|
||||
message: 'I found code in the URI. Loading now.'
|
||||
}),
|
||||
savedCodeFound(finalFiles)
|
||||
savedCodeFound(finalFiles, challenge)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -118,7 +122,7 @@ export function loadCodeSaga(actions$, getState, { window, location }) {
|
||||
makeToast({
|
||||
message: 'I found some saved work. Loading now.'
|
||||
}),
|
||||
savedCodeFound(finalFiles),
|
||||
savedCodeFound(finalFiles, challenge),
|
||||
updateMain()
|
||||
);
|
||||
}
|
||||
@@ -135,7 +139,7 @@ export function loadCodeSaga(actions$, getState, { window, location }) {
|
||||
makeToast({
|
||||
message: 'I found a previous solved solution. Loading now.'
|
||||
}),
|
||||
savedCodeFound(finalFiles),
|
||||
savedCodeFound(finalFiles, challenge),
|
||||
updateMain()
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user