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:
Budbreaker
2021-10-06 15:18:02 +02:00
committed by GitHub
parent 83354c5632
commit bc802cbbbd
15 changed files with 70 additions and 14 deletions

View File

@@ -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) || [];