feat: added warning for unreachable server (#43576)
* feat: added warning for unreachable server * fix: update initial state in test file * fix: make offline warning scroll with page * adjust z-indexes for warning banners * add hyperlink for offline warning
This commit is contained in:
@@ -15,7 +15,11 @@ import { backEndProject } from '../../utils/challenge-types';
|
||||
import { isGoodXHRStatus } from '../templates/Challenges/utils';
|
||||
import postUpdate$ from '../templates/Challenges/utils/postUpdate$';
|
||||
import { actionTypes } from './action-types';
|
||||
import { onlineStatusChange, isOnlineSelector, isSignedInSelector } from './';
|
||||
import {
|
||||
serverStatusChange,
|
||||
isServerOnlineSelector,
|
||||
isSignedInSelector
|
||||
} from './';
|
||||
|
||||
const key = 'fcc-failed-updates';
|
||||
|
||||
@@ -37,14 +41,14 @@ function failedUpdateEpic(action$, state$) {
|
||||
store.set(key, [...failures, payload]);
|
||||
}
|
||||
}),
|
||||
map(() => onlineStatusChange(false))
|
||||
map(() => serverStatusChange(false))
|
||||
);
|
||||
|
||||
const flushUpdates = action$.pipe(
|
||||
ofType(actionTypes.fetchUserComplete, actionTypes.updateComplete),
|
||||
filter(() => isSignedInSelector(state$.value)),
|
||||
filter(() => store.get(key)),
|
||||
filter(() => isOnlineSelector(state$.value)),
|
||||
filter(() => isServerOnlineSelector(state$.value)),
|
||||
tap(() => {
|
||||
let failures = store.get(key) || [];
|
||||
|
||||
|
Reference in New Issue
Block a user