Commit 664ce79f authored by Saturnino Abril's avatar Saturnino Abril
Browse files

remove Clien4.online and setOnline (#815)

parent 05022678
......@@ -89,7 +89,9 @@
"default",
"jest-junit"
],
"setupTestFrameworkScriptFile": "<rootDir>/test/setup.js",
"setupFilesAfterEnv": [
"<rootDir>/test/setup.js"
],
"testPathIgnorePatterns": [
"/node_modules/"
]
......
......@@ -36,7 +36,6 @@ export default class Client4 {
this.userId = '';
this.diagnosticId = '';
this.includeCookies = true;
this.online = true;
this.translations = {
connectionError: 'There appears to be a problem with your internet connection.',
......@@ -52,10 +51,6 @@ export default class Client4 {
this.url = url;
}
setOnline(online) {
this.online = online;
}
setUserAgent(userAgent) {
this.userAgent = userAgent;
}
......@@ -2668,13 +2663,6 @@ export default class Client4 {
};
doFetchWithResponse = async (url, options) => {
if (!this.online) {
throw new ClientError(this.getUrl(), {
message: 'no internet connection',
url,
});
}
const response = await fetch(url, this.getOptions(options));
const headers = parseAndMergeNestedHeaders(response.headers);
......
......@@ -7,7 +7,6 @@ import devTools from 'remote-redux-devtools';
import {createOfflineReducer, networkStatusChangedAction, offlineCompose} from 'redux-offline';
import defaultOfflineConfig from 'redux-offline/lib/defaults';
import reducerRegistry from 'store/reducer_registry';
import {Client4} from 'client';
const devToolsEnhancer = (
typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION__ ? // eslint-disable-line no-underscore-dangle
......@@ -66,7 +65,6 @@ export default function configureServiceStore(preloadedState, appReducer, userOf
if (baseOfflineConfig.detectNetwork) {
baseOfflineConfig.detectNetwork((online) => {
Client4.setOnline(online);
store.dispatch(networkStatusChangedAction(online));
});
}
......
......@@ -5,7 +5,6 @@ import {createStore} from 'redux';
import {createOfflineReducer, networkStatusChangedAction, offlineCompose} from 'redux-offline';
import defaultOfflineConfig from 'redux-offline/lib/defaults';
import reducerRegistry from 'store/reducer_registry';
import {Client4} from 'client';
import serviceReducer from 'reducers';
......@@ -49,7 +48,6 @@ export default function configureOfflineServiceStore(preloadedState, appReducer,
if (baseOfflineConfig.detectNetwork) {
baseOfflineConfig.detectNetwork((online) => {
Client4.setOnline(online);
store.dispatch(networkStatusChangedAction(online));
});
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment