Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

fix import errors

ammarahm-ed00af55faaebe
diff --git a/apps/mobile/src/screens/settings/2fa.tsx b/apps/mobile/src/screens/settings/2fa.tsx
index d97b1c081..9310ba5e5 100644
--- a/apps/mobile/src/screens/settings/2fa.tsx
+++ b/apps/mobile/src/screens/settings/2fa.tsx
@@ -23,92 +23,6 @@ import useTimer from '../../utils/hooks/use-timer';
import { sanitizeFilename } from '../../utils/sanitizer';
import { SIZE } from '../../utils/size';
import { sleep } from '../../utils/time';
-import { CustomButton } from './button';
-import { verifyUser } from './functions';
-import SectionHeader from './section-header';
-
-const TwoFactorAuth = ({ isSheet }: { isSheet: boolean }) => {
- const [collapsed, setCollapsed] = useState(isSheet ? false : true);
- const user = useUserStore(state => state.user);
-
- const enable2fa = () => {
- verifyUser('global', async () => {
- MFASheet.present();
- });
- };
-
- const disable2fa = () => {
- verifyUser('global', async () => {
- await db.mfa?.disable();
- let user = await db.user?.fetchUser();
- useUserStore.getState().setUser(user);
- });
- };
-
- const mfaSettingsList = user?.mfa?.isEnabled
- ? [
- {
- name: user.mfa?.secondaryMethod
- ? 'Reconfigure fallback 2FA method'
- : 'Add fallback 2FA method',
- func: () => {
- verifyUser('global', async () => {
- MFASheet.present(true);
- });
- },
- desc: 'You can use fallback 2FA method incase you are unable to login via primary method'
- },
- {
- name: 'View recovery codes',
- func: () => {
- verifyUser('global', async () => {
- MFARecoveryCodes.present('sms');
- });
- },
- desc: 'View and save recovery codes for to recover your account'
- },
- {
- name: 'Disable two-factor authentication',
- func: disable2fa,
- desc: 'Decreased security for your account'
- }
- ]
- : [
- {
- name: 'Enable two-factor authentication',
- func: enable2fa,
- desc: 'Increased security for your account'
- }
- ];
-
- return (
- <>
- {!isSheet && (
- <SectionHeader
- collapsed={collapsed}
- setCollapsed={setCollapsed}
- title="Two Factor Authentication"
- />
- )}
-
- {!collapsed && (
- <>
- {mfaSettingsList.map(item => (
- //@ts-ignore
- <CustomButton
- key={item.name}
- title={item.name}
- tagline={item.desc}
- onPress={item.func}
- />
- ))}
- </>
- )}
- </>
- );
-};
-
-export default TwoFactorAuth;
const mfaMethods: MFAMethod[] = [
{
diff --git a/apps/mobile/src/screens/settings/usersection.js b/apps/mobile/src/screens/settings/usersection.js
index c233e5830..6499ddfad 100644
--- a/apps/mobile/src/screens/settings/usersection.js
+++ b/apps/mobile/src/screens/settings/usersection.js
@@ -1,39 +1,25 @@
import dayjs from 'dayjs';
import React from 'react';
-import { Linking, Platform, Text, View } from 'react-native';
-import * as RNIap from 'react-native-iap';
+import { Linking, Platform, View } from 'react-native';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
-import { ChangePassword } from '../../components/auth/change-password';
-import { Progress } from '../../components/sheets/progress';
import { Button } from '../../components/ui/button';
import Seperator from '../../components/ui/seperator';
+import { TimeSince } from '../../components/ui/time-since';
import Heading from '../../components/ui/typography/heading';
import Paragraph from '../../components/ui/typography/paragraph';
import { eSendEvent, presentSheet, ToastEvent } from '../../services/event-manager';
import PremiumService from '../../services/premium';
-import Sync from '../../services/sync';
import { useUserStore } from '../../stores/stores';
import { useThemeStore } from '../../stores/theme';
-
-import { SectionItem } from './section-item';
import {
SUBSCRIPTION_PROVIDER,
SUBSCRIPTION_STATUS,
SUBSCRIPTION_STATUS_STRINGS
} from '../../utils/constants';
-import {
- eCloseProgressDialog,
- eOpenAttachmentsDialog,
- eOpenPremiumDialog,
- eOpenRecoveryKeyDialog
-} from '../../utils/events';
+import { eOpenPremiumDialog } from '../../utils/events';
import { usePricing } from '../../utils/hooks/use-pricing';
import { SIZE } from '../../utils/size';
-import { sleep } from '../../utils/time';
-import TwoFactorAuth from './2fa';
-import { CustomButton } from './button';
-import { verifyUser } from './functions';
-import { TimeSince } from '../../components/ui/time-since';
+import { SectionItem } from './section-item';
export const getTimeLeft = t2 => {
let daysRemaining = dayjs(t2).diff(dayjs(), 'days');