mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-21 14:09:34 +01:00
cleanup and refactor
This commit is contained in:
@@ -9,14 +9,16 @@ import {
|
||||
} from 'react-native';
|
||||
import {useSafeAreaInsets} from 'react-native-safe-area-context';
|
||||
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
|
||||
import {pv, SIZE, WEIGHT} from '../../common/common';
|
||||
import {useTracked} from '../../provider';
|
||||
import {ACTIONS} from '../../provider/actions';
|
||||
import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/eventManager';
|
||||
import {eOpenMoveNoteDialog} from '../../services/events';
|
||||
import {db, DDS, getElevation, ToastEvent} from '../../utils/utils';
|
||||
import {Actions} from '../../provider/Actions';
|
||||
import {eSubscribeEvent, eUnSubscribeEvent, ToastEvent} from '../../services/EventManager';
|
||||
import {eOpenMoveNoteDialog} from '../../utils/Events';
|
||||
import {getElevation} from '../../utils';
|
||||
import {PressableButton} from '../PressableButton';
|
||||
import {Toast} from '../Toast';
|
||||
import {pv, SIZE, WEIGHT} from "../../utils/SizeUtils";
|
||||
import {db} from "../../utils/DB";
|
||||
import {DDS} from "../../services/DeviceDetection";
|
||||
|
||||
let newNotebookTitle = null;
|
||||
let newTopicTitle = null;
|
||||
@@ -64,8 +66,8 @@ const MoveNoteDialog = () => {
|
||||
});
|
||||
notebookInput.current?.clear();
|
||||
notebookInput.current?.blur();
|
||||
dispatch({type: ACTIONS.NOTEBOOKS});
|
||||
dispatch({type: ACTIONS.PINNED});
|
||||
dispatch({type: Actions.NOTEBOOKS});
|
||||
dispatch({type: Actions.PINNED});
|
||||
};
|
||||
|
||||
const addNewTopic = async () => {
|
||||
@@ -75,8 +77,8 @@ const MoveNoteDialog = () => {
|
||||
|
||||
let res = await db.notebooks.notebook(expanded).topics.add(newTopicTitle);
|
||||
|
||||
dispatch({type: ACTIONS.NOTEBOOKS});
|
||||
dispatch({type: ACTIONS.PINNED});
|
||||
dispatch({type: Actions.NOTEBOOKS});
|
||||
dispatch({type: Actions.PINNED});
|
||||
topicInput.current?.clear();
|
||||
topicInput.current?.blur();
|
||||
newTopicTitle = null;
|
||||
@@ -364,9 +366,9 @@ const MoveNoteDialog = () => {
|
||||
},
|
||||
...noteIds,
|
||||
);
|
||||
dispatch({type: ACTIONS.CLEAR_SELECTION});
|
||||
dispatch({type: ACTIONS.NOTEBOOKS});
|
||||
dispatch({type: ACTIONS.PINNED});
|
||||
dispatch({type: Actions.CLEAR_SELECTION});
|
||||
dispatch({type: Actions.NOTEBOOKS});
|
||||
dispatch({type: Actions.PINNED});
|
||||
close();
|
||||
let notebookName = db.notebooks.notebook(
|
||||
item.notebookId,
|
||||
|
||||
Reference in New Issue
Block a user