Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
fix: remove reachability service
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Dec 31, 2021
1 parent 21a0123 commit e200df2
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 137 deletions.
6 changes: 0 additions & 6 deletions ios/Podfile.lock
Expand Up @@ -216,8 +216,6 @@ PODS:
- React-Core
- react-native-mail (4.1.0):
- React-Core
- react-native-netinfo (6.0.6):
- React-Core
- react-native-safe-area-context (3.1.9):
- React-Core
- react-native-segmented-control (2.2.2):
Expand Down Expand Up @@ -362,7 +360,6 @@ DEPENDENCIES:
- react-native-document-picker (from `../node_modules/react-native-document-picker`)
- react-native-fingerprint-scanner (from `../node_modules/react-native-fingerprint-scanner`)
- react-native-mail (from `../node_modules/react-native-mail`)
- "react-native-netinfo (from `../node_modules/@react-native-community/netinfo`)"
- react-native-safe-area-context (from `../node_modules/react-native-safe-area-context`)
- "react-native-segmented-control (from `../node_modules/@react-native-community/segmented-control`)"
- react-native-sodium (from `../node_modules/react-native-sodium`)
Expand Down Expand Up @@ -449,8 +446,6 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native-fingerprint-scanner"
react-native-mail:
:path: "../node_modules/react-native-mail"
react-native-netinfo:
:path: "../node_modules/@react-native-community/netinfo"
react-native-safe-area-context:
:path: "../node_modules/react-native-safe-area-context"
react-native-segmented-control:
Expand Down Expand Up @@ -547,7 +542,6 @@ SPEC CHECKSUMS:
react-native-document-picker: 1a7518132d4a06b67f459be9bb1464a567d2b3b4
react-native-fingerprint-scanner: be63e626b31fb951780a5fac5328b065a61a3d6e
react-native-mail: 5fe7239a5b5c1e858d425501c03d1ab977434122
react-native-netinfo: 40b91995cd49c33ae57996486db76f0af067b630
react-native-safe-area-context: b6e0e284002381d2ff29fa4fff42b4d8282e3c94
react-native-segmented-control: 65df6cd0619b780b3843d574a72d4c7cec396097
react-native-sodium: 6cc4c4c1ea331f9f2b478076e983e09827a7b23f
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -22,7 +22,6 @@
"@expo/react-native-action-sheet": "^3.8.0",
"@react-native-community/async-storage": "1.12.1",
"@react-native-community/masked-view": "^0.1.10",
"@react-native-community/netinfo": "^6.0.6",
"@react-native-community/segmented-control": "^2.2.2",
"@react-navigation/native": "^5.9.3",
"@react-navigation/stack": "^5.14.3",
Expand Down
16 changes: 5 additions & 11 deletions src/App.tsx
Expand Up @@ -3,7 +3,6 @@ import { ActionSheetProvider } from '@expo/react-native-action-sheet';
import { MobileApplication } from '@Lib/application';
import { ApplicationGroup } from '@Lib/application_group';
import { navigationRef } from '@Lib/navigation_service';
import { NetworkService, NetworkServiceContext } from '@Lib/network_service';
import { DefaultTheme, NavigationContainer } from '@react-navigation/native';
import { DeinitSource } from '@standardnotes/snjs';
import { MobileThemeVariables } from '@Style/Themes/styled-components';
Expand Down Expand Up @@ -127,9 +126,6 @@ const AppComponent: React.FC<{
const AppGroupInstance = new ApplicationGroup();
AppGroupInstance.initialize();

const networkServiceInstance = new NetworkService();
networkServiceInstance.registerObservers();

export const App = (props: { env: 'prod' | 'dev'; bugsnagOptOut: true }) => {
const applicationGroupRef = useRef(AppGroupInstance);
const [application, setApplication] = useState<
Expand Down Expand Up @@ -160,13 +156,11 @@ export const App = (props: { env: 'prod' | 'dev'; bugsnagOptOut: true }) => {
return (
<ApplicationContext.Provider value={application}>
{application && (
<NetworkServiceContext.Provider value={networkServiceInstance}>
<AppComponent
env={props.env}
key={application.Uuid}
application={application}
/>
</NetworkServiceContext.Provider>
<AppComponent
env={props.env}
key={application.Uuid}
application={application}
/>
)}
</ApplicationContext.Provider>
);
Expand Down
102 changes: 0 additions & 102 deletions src/lib/network_service.ts

This file was deleted.

12 changes: 0 additions & 12 deletions src/screens/ManageSessions/ManageSessions.tsx
@@ -1,4 +1,3 @@
import { useIsOffline } from '@Lib/network_service';
import { ApplicationContext } from '@Root/ApplicationContext';
import { LoadingContainer, LoadingText } from '@Screens/Notes/NoteList.styled';
import {
Expand Down Expand Up @@ -90,7 +89,6 @@ export const ManageSessions: React.FC = () => {
const { showActionSheet } = useCustomActionSheet();
const theme = useContext(ThemeContext);
const insets = useSafeAreaInsets();
const [isOffline] = useIsOffline();

const [
sessions,
Expand Down Expand Up @@ -146,16 +144,6 @@ export const ManageSessions: React.FC = () => {
);
};

if (isOffline) {
return (
<LoadingContainer>
<LoadingText textAlign="center">
{'You are offline.\nPlease check your network connection.'}
</LoadingText>
</LoadingContainer>
);
}

if (errorMessage) {
return (
<LoadingContainer>
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Expand Up @@ -1534,11 +1534,6 @@
resolved "https://registry.yarnpkg.com/@react-native-community/masked-view/-/masked-view-0.1.10.tgz#5dda643e19e587793bc2034dd9bf7398ad43d401"
integrity sha512-rk4sWFsmtOw8oyx8SD3KSvawwaK7gRBSEIy2TAwURyGt+3TizssXP1r8nx3zY+R7v2vYYHXZ+k2/GULAT/bcaQ==

"@react-native-community/netinfo@^6.0.6":
version "6.0.6"
resolved "https://registry.yarnpkg.com/@react-native-community/netinfo/-/netinfo-6.0.6.tgz#41a81786aed010926ab63d5f576025c9688a2ed0"
integrity sha512-Lyshmg15NfKLPp3evXkg8yrhBpJlzb4b7M9z5/yDqot7P2WNmBmOYfsYjhlTCLmBV/N/U+MnA5V5NGmUKUS49A==

"@react-native-community/segmented-control@^2.2.2":
version "2.2.2"
resolved "https://registry.yarnpkg.com/@react-native-community/segmented-control/-/segmented-control-2.2.2.tgz#4014256819ab8f40f6bc3a3929ff14a9d149cf04"
Expand Down

0 comments on commit e200df2

Please sign in to comment.