Skip to content

Commit

Permalink
Merge branch 'master' into bump/NodejsV18
Browse files Browse the repository at this point in the history
  • Loading branch information
RodriSanchez1 committed Nov 22, 2023
2 parents fa8e641 + 60f94fa commit 4e03528
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 97 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"react-helmet": "^6.1.0",
"react-icons": "^4.11.0",
"react-intl": "^2.7.2",
"react-joyride": "^2.6.0",
"react-joyride": "^2.5.4",
"react-markdown": "^5.0.3",
"react-media-recorder": "^0.7.1",
"react-redux": "^5.1.2",
Expand Down
10 changes: 9 additions & 1 deletion src/components/App/App.actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,19 @@ import {
DISABLE_TOUR,
ENABLE_ALL_TOURS,
SET_UNLOGGED_USER_LOCATION,
UPDATE_SYMBOLS_SETTINGS
UPDATE_SYMBOLS_SETTINGS,
UPDATE_CONNECTIVITY
} from './App.constants';

import { updateIsInFreeCountry } from '../../providers/SubscriptionProvider/SubscriptionProvider.actions';

export function updateConnectivity({ isConnected = false }) {
return {
type: UPDATE_CONNECTIVITY,
payload: isConnected
};
}

export function updateDisplaySettings(payload = {}) {
return {
type: UPDATE_DISPLAY_SETTINGS,
Expand Down
36 changes: 34 additions & 2 deletions src/components/App/App.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import { DISPLAY_SIZE_STANDARD } from '../Settings/Display/Display.constants';
import {
updateUserDataFromAPI,
updateLoggedUserLocation,
updateUnloggedUserLocation
updateUnloggedUserLocation,
updateConnectivity
} from '../App/App.actions';
import { isCordova, isElectron } from '../../cordova-util';
export class AppContainer extends Component {
Expand Down Expand Up @@ -85,6 +86,36 @@ export class AppContainer extends Component {
localizeUser();

if (isCordova()) initCVAGa4();

const configureConnectionStatus = () => {
const { updateConnectivity } = this.props;
const setAsOnline = () => {
updateConnectivity({ isConnected: true });
};

const setAsOffline = () => {
updateConnectivity({ isConnected: false });
};

const addConnectionEventListeners = () => {
window.addEventListener('offline', setAsOffline);
window.addEventListener('online', setAsOnline);
};

const setCurrentConnectionStatus = () => {
if (!navigator.onLine) {
setAsOffline();
return;
}
setAsOnline();
return;
};

setCurrentConnectionStatus();
addConnectionEventListeners();
};

configureConnectionStatus();
}

handleNewContentAvailable = () => {
Expand Down Expand Up @@ -148,7 +179,8 @@ const mapDispatchToProps = {
showNotification,
updateUserDataFromAPI,
updateLoggedUserLocation,
updateUnloggedUserLocation
updateUnloggedUserLocation,
updateConnectivity
};

export default connect(
Expand Down
18 changes: 8 additions & 10 deletions src/components/WelcomeScreen/WelcomeScreen.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,17 @@ export class WelcomeScreen extends Component {
handleGoogleLoginClick = () => {
const { intl } = this.props;
if (isAndroid() || isIOS()) {
window.plugins.googleplus.login(
{
// 'scopes': '... ', // optional, space-separated list of scopes, If not included or empty, defaults to `profile` and `email`.
offline: true // optional, but requires the webClientId - if set to true the plugin will also return a serverAuthCode, which can be used to grant offline access to a non-Google server
},
function(obj) {
window.location.hash = `#/login/googletoken/callback?access_token=${
obj.accessToken
const FirebasePlugin = window.FirebasePlugin;
FirebasePlugin.authenticateUserWithGoogle(
process.env.REACT_APP_GOOGLE_FIREBASE_WEB_CLIENT_SIGN_IN,
function(credential) {
window.location.hash = `#/login/googleidtoken/callback?id_token=${
credential.idToken
}`;
},
function(msg) {
function(error) {
alert(intl.formatMessage(messages.loginErrorAndroid));
console.log('error: ' + msg);
console.error('Failed to authenticate with Google: ' + error);
}
);
} else {
Expand Down
16 changes: 0 additions & 16 deletions src/store.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import { persistStore } from 'redux-persist';
import { UPDATE_CONNECTIVITY } from './components/App/App.constants';
import googleAnalytics from './analytics';
import createReducer from './reducers';

Expand All @@ -26,21 +25,6 @@ export default function configureStore(initialState = {}) {
composeEnhancers(...enhancers)
);

// TODO refactor not here
window.addEventListener('offline', () => {
store.dispatch({
type: UPDATE_CONNECTIVITY,
payload: false
});
});

window.addEventListener('online', () => {
store.dispatch({
type: UPDATE_CONNECTIVITY,
payload: true
});
});

const persistor = persistStore(store);

return { persistor, store };
Expand Down
88 changes: 21 additions & 67 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1886,26 +1886,6 @@
resolved "https://registry.yarnpkg.com/@gilbarbara/deep-equal/-/deep-equal-0.1.2.tgz#1a106721368dba5e7e9fb7e9a3a6f9efbd8df36d"
integrity sha512-jk+qzItoEb0D0xSSmrKDDzf9sheQj/BAPxlgNxgmOaA3mxpUa6ndJLYGZKsJnIVEQSD8zcTbyILz7I0HcnBCRA==

"@gilbarbara/deep-equal@^0.3.1":
version "0.3.1"
resolved "https://registry.yarnpkg.com/@gilbarbara/deep-equal/-/deep-equal-0.3.1.tgz#9c72ed0b2e6f8edb1580217e28d78b5b03ad4aee"
integrity sha512-I7xWjLs2YSVMc5gGx1Z3ZG1lgFpITPndpi8Ku55GeEIKpACCPQNS/OTqQbxgTCfq0Ncvcc+CrFov96itVh6Qvw==

"@gilbarbara/helpers@^0.9.0":
version "0.9.0"
resolved "https://registry.yarnpkg.com/@gilbarbara/helpers/-/helpers-0.9.0.tgz#2572589da633ec820b740213a1d4d3439e136950"
integrity sha512-hl96DIoGgyJkjyiOGwEC6kZnYCsYSjhR8QTbvl7+i74fdllPgJeq4oCLH7HPiFGtnhCh4RuXTa4fmfy/8McAVQ==
dependencies:
"@gilbarbara/types" "^0.2.2"
is-lite "^1.2.0"

"@gilbarbara/types@^0.2.2":
version "0.2.2"
resolved "https://registry.yarnpkg.com/@gilbarbara/types/-/types-0.2.2.tgz#397d66e5e4b1c44b65093b61e1e2bc0518b7d498"
integrity sha512-QuQDBRRcm1Q8AbSac2W1YElurOhprj3Iko/o+P1fJxUWS4rOGKMVli98OXS7uo4z+cKAif6a+L9bcZFSyauQpQ==
dependencies:
type-fest "^4.1.0"

"@humanwhocodes/config-array@^0.11.13":
version "0.11.13"
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.13.tgz#075dc9684f40a531d9b26b0822153c1e832ee297"
Expand Down Expand Up @@ -5638,22 +5618,17 @@ dedent@^0.7.0:
resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c"
integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==

deep-diff@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/deep-diff/-/deep-diff-1.0.2.tgz#afd3d1f749115be965e89c63edc7abb1506b9c26"
integrity sha512-aWS3UIVH+NPGCD1kki+DCU9Dua032iSsO43LqQpcs4R3+dVv7tX0qBGjiVHJHjplsoUM2XRO/KB92glqc68awg==

deep-equal@^1.0.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.2.tgz#78a561b7830eef3134c7f6f3a3d6af272a678761"
integrity sha512-5tdhKF6DbU7iIzrIOa1AOUt39ZRm13cmL1cGEh//aqR8x9+tNfbywRf0n5FD/18OKMdo7DNEtrX2t22ZAkI+eg==
version "1.1.1"
resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a"
integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g==
dependencies:
is-arguments "^1.1.1"
is-date-object "^1.0.5"
is-regex "^1.1.4"
object-is "^1.1.5"
is-arguments "^1.0.4"
is-date-object "^1.0.1"
is-regex "^1.0.4"
object-is "^1.0.1"
object-keys "^1.1.1"
regexp.prototype.flags "^1.5.1"
regexp.prototype.flags "^1.2.0"

deep-extend@^0.6.0:
version "0.6.0"
Expand Down Expand Up @@ -8124,10 +8099,10 @@ is-lite@^0.8.2:
resolved "https://registry.yarnpkg.com/is-lite/-/is-lite-0.8.2.tgz#26ab98b32aae8cc8b226593b9a641d2bf4bd3b6a"
integrity sha512-JZfH47qTsslwaAsqbMI3Q6HNNjUuq6Cmzzww50TdP5Esb6e1y2sK2UAaZZuzfAzpoI2AkxoPQapZdlDuP6Vlsw==

is-lite@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/is-lite/-/is-lite-1.2.0.tgz#f64e67523251ce8d3a070bc50c89814c1951fa58"
integrity sha512-Q9EaBEC0QV44D9iyoLMJQPEF2qMOG3TgfPCm1/lnorU5Y0PJbEqlaqX0vSBxVnxqL/m2rE4ZqRhe2OEAgVdJHA==
is-lite@^0.9.2:
version "0.9.2"
resolved "https://registry.yarnpkg.com/is-lite/-/is-lite-0.9.2.tgz#4b19e9a26b7c99ed50f748bcf088db57893d0730"
integrity sha512-qZuxbaEiKLOKhX4sbHLfhFN9iA3YciuZLb37/DfXCpWnz8p7qNL2lwkpxYMXfjlS8eEEjpULPZxAUI8N6FYvYQ==

is-map@^2.0.1:
version "2.0.2"
Expand Down Expand Up @@ -11602,11 +11577,6 @@ react-icons@^4.11.0:
resolved "https://registry.yarnpkg.com/react-icons/-/react-icons-4.12.0.tgz#54806159a966961bfd5cdb26e492f4dafd6a8d78"
integrity sha512-IBaDuHiShdZqmfc/TwHu6+d6k2ltNCf3AszxNmjJc1KUfXdEeRJOKyNvLmAHaarhzGmTSVygNdyu8/opXv2gaw==

react-innertext@^1.1.5:
version "1.1.5"
resolved "https://registry.yarnpkg.com/react-innertext/-/react-innertext-1.1.5.tgz#8147ac54db3f7067d95f49e2d2c05a720d27d8d0"
integrity sha512-PWAqdqhxhHIv80dT9znP2KvS+hfkbRovFp4zFYHFFlOoQLRiawIic81gKb3U1wEyJZgMwgs3JoLtwryASRWP3Q==

react-intl@^2.7.2:
version "2.9.0"
resolved "https://registry.yarnpkg.com/react-intl/-/react-intl-2.9.0.tgz#c97c5d17d4718f1575fdbd5a769f96018a3b1843"
Expand All @@ -11633,23 +11603,20 @@ react-is@^16.13.1, react-is@^16.6.0, react-is@^16.7.0, react-is@^16.8.6:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

react-joyride@^2.6.0:
version "2.7.0"
resolved "https://registry.yarnpkg.com/react-joyride/-/react-joyride-2.7.0.tgz#78b33a567f20d44daebfa03f3ea2f5cefa5a532d"
integrity sha512-fWcIKhat6okO4gLXMz8SRUTIQKmh3dHGzsEQxHVwGNBBFd3z/KQMYVu82dBX448ASTmSG1OJhA7lqBmKX7OQVA==
react-joyride@^2.5.4:
version "2.5.5"
resolved "https://registry.yarnpkg.com/react-joyride/-/react-joyride-2.5.5.tgz#a12024902347bea0a565ad2e69b291e35c6a274b"
integrity sha512-/esW9IcsuQJr4NcRZJUH8UYYTvB/yzVC0IyElopbjMFYPw3aylSny91QO3mQRRKPQJUqYa6wREOtQpsaLbu9fw==
dependencies:
"@gilbarbara/deep-equal" "^0.3.1"
"@gilbarbara/helpers" "^0.9.0"
deep-diff "^1.0.2"
deepmerge "^4.3.1"
is-lite "^1.2.0"
exenv "^1.2.2"
is-lite "^0.9.2"
prop-types "^15.8.1"
react-floater "^0.7.6"
react-innertext "^1.1.5"
react-is "^16.13.1"
scroll "^3.0.1"
scrollparent "^2.1.0"
tree-changes "^0.11.1"
type-fest "^4.7.1"
tree-changes "^0.9.2"

react-lifecycles-compat@^3.0.0:
version "3.0.4"
Expand Down Expand Up @@ -13560,15 +13527,7 @@ tr46@^3.0.0:
resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9"
integrity sha512-iawgk0hLP3SxGKDfnDJf8wTz4p2qImnyihM5Hh/sGvQ3K37dPi/w8sRhdNIxYA1TwFwc5mDhIJq+O0RsvXBKdQ==

tree-changes@^0.11.1:
version "0.11.2"
resolved "https://registry.yarnpkg.com/tree-changes/-/tree-changes-0.11.2.tgz#e02e65c4faae6230dfe357aa97a26e8eb7c7d321"
integrity sha512-4gXlUthrl+RabZw6lLvcCDl6KfJOCmrC16BC5CRdut1EAH509Omgg0BfKLY+ViRlzrvYOTWR0FMS2SQTwzumrw==
dependencies:
"@gilbarbara/deep-equal" "^0.3.1"
is-lite "^1.2.0"

tree-changes@^0.9.1:
tree-changes@^0.9.1, tree-changes@^0.9.2:
version "0.9.3"
resolved "https://registry.yarnpkg.com/tree-changes/-/tree-changes-0.9.3.tgz#89433ab3b4250c2910d386be1f83912b7144efcc"
integrity sha512-vvvS+O6kEeGRzMglTKbc19ltLWNtmNt1cpBoSYLj/iEcPVvpJasemKOlxBrmZaCtDJoF+4bwv3m01UKYi8mukQ==
Expand Down Expand Up @@ -13702,11 +13661,6 @@ type-fest@^2.14.0:
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-2.19.0.tgz#88068015bb33036a598b952e55e9311a60fd3a9b"
integrity sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==

type-fest@^4.1.0, type-fest@^4.7.1:
version "4.8.1"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.8.1.tgz#2a5bf1074abb580d2d6eb5c1e79c11147fd11d4f"
integrity sha512-ShaaYnjf+0etG8W/FumARKMjjIToy/haCaTjN2dvcewOSoNqCQzdgG7m2JVOlM5qndGTHjkvsrWZs+k/2Z7E0Q==

type-is@~1.6.18:
version "1.6.18"
resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131"
Expand Down

0 comments on commit 4e03528

Please sign in to comment.