Skip to content

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

cleanup

ammarahm-ed175457393f1c
diff --git a/apps/mobile/src/utils/utils.js b/apps/mobile/src/utils/utils.js
index be680eaec..9637cff28 100755
--- a/apps/mobile/src/utils/utils.js
+++ b/apps/mobile/src/utils/utils.js
@@ -11,9 +11,20 @@ import {
} from '../services/events';
import {DeviceDetectionService} from './deviceDetection';
import StorageInterface from './storage';
+import MMKV from 'react-native-mmkv-storage';
+import {updateEvent} from '../components/DialogManager/recievers';
+import {ACTIONS} from '../provider/actions';
export const DDS = new DeviceDetectionService();
export const db = new Storage(StorageInterface);
+export async function setSetting(settings, name, value) {
+ let s = {...settings};
+ s[name] = value;
+ await MMKV.setString('settings', JSON.stringify(s));
+
+ updateEvent({type: ACTIONS.SETTINGS, settings: s});
+}
+
export const getElevation = elevation => {
return {
elevation,
diff --git a/apps/mobile/src/views/Settings/index.js b/apps/mobile/src/views/Settings/index.js
index de0ef521a..9952a8eec 100644
--- a/apps/mobile/src/views/Settings/index.js
+++ b/apps/mobile/src/views/Settings/index.js
@@ -27,15 +27,7 @@ import {ACTIONS} from '../../provider/actions';
import {eSendEvent} from '../../services/eventManager';
import {eOpenLoginDialog} from '../../services/events';
import NavigationService from '../../services/NavigationService';
-import {hexToRGBA, w, DDS} from '../../utils/utils';
-
-export async function setSetting(settings, name, value) {
- let s = {...settings};
- s[name] = value;
- await MMKV.setString('settings', JSON.stringify(s));
-
- updateEvent({type: ACTIONS.SETTINGS, settings: s});
-}
+import {hexToRGBA, w, DDS, setSetting} from '../../utils/utils';
export const Settings = ({navigation}) => {
const [state, dispatch] = useTracked();