Skip to content

Commit

Permalink
fix(mobile): enable workspaces (#1139)
Browse files Browse the repository at this point in the history
  • Loading branch information
moughxyz committed Jun 22, 2022
1 parent 480d17f commit 4db63e3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
5 changes: 1 addition & 4 deletions packages/mobile/src/Lib/Interface.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { WorkspacesEnabled } from '@Lib/constants'
import AsyncStorage from '@react-native-community/async-storage'
import SNReactNative from '@standardnotes/react-native-utils'
import {
Expand Down Expand Up @@ -322,9 +321,7 @@ export class MobileDeviceInterface implements DeviceInterface {
}

performSoftReset() {
if (WorkspacesEnabled) {
SNReactNative.exitApp()
}
SNReactNative.exitApp()
}

// eslint-disable-next-line @typescript-eslint/no-empty-function
Expand Down
4 changes: 0 additions & 4 deletions packages/mobile/src/Lib/constants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import { IsDev } from '@Lib/Utils'

export enum ErrorMessage {
GeneralText = 'An error occurred. Please try again later.',
}

export const WorkspacesEnabled = IsDev
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { WorkspacesEnabled } from '@Lib/constants'
import { useSignedIn } from '@Lib/SnjsHelperHooks'
import { useNavigation } from '@react-navigation/native'
import { ButtonCell } from '@Root/Components/ButtonCell'
Expand Down Expand Up @@ -80,9 +79,7 @@ export const OptionsSection = ({ title, encryptionAvailable }: Props) => {
let signoutText =
'Signing out will remove all data from this device, including notes and tags. Make sure your data is synced before proceeding.'

if (WorkspacesEnabled) {
signoutText += '\n\nYour app will quit after sign out completes.'
}
signoutText += '\n\nYour app will quit after sign out completes.'

if (await application.alertService.confirm(signoutText, 'Sign Out?', 'Sign Out', ButtonType.Danger)) {
await application.user.signOut()
Expand Down
3 changes: 1 addition & 2 deletions packages/mobile/src/Screens/Settings/Settings.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { WorkspacesEnabled } from '@Lib/constants'
import { useSignedIn } from '@Lib/SnjsHelperHooks'
import { useSafeApplicationContext } from '@Root/Hooks/useSafeApplicationContext'
import { ModalStackNavigationProp } from '@Root/ModalStack'
Expand Down Expand Up @@ -56,7 +55,7 @@ export const Settings = (props: Props) => {
<Container keyboardShouldPersistTaps={'always'} keyboardDismissMode={'interactive'}>
<AuthSection title="Account" signedIn={signedIn} />
<OptionsSection encryptionAvailable={!!encryptionAvailable} title="Options" />
{WorkspacesEnabled && <WorkspacesSection />}
<WorkspacesSection />
<PreferencesSection />
{application.hasAccount() && isEntitledToFiles && <FilesSection />}
<SecuritySection
Expand Down

0 comments on commit 4db63e3

Please sign in to comment.