chore: move draftMessage to helpers
This commit is contained in:
parent
55f3de5449
commit
63df0ce1c2
|
@ -7,7 +7,7 @@ import { RouteProp, useFocusEffect, useRoute } from '@react-navigation/native';
|
|||
import I18n from '../../../i18n';
|
||||
import { IAutocompleteItemProps, IComposerInput, IComposerInputProps, IInputSelection, TSetInput } from '../interfaces';
|
||||
import { useAutocompleteParams, useFocused, useMessageComposerApi } from '../context';
|
||||
import { loadDraftMessage, fetchIsAllOrHere, getMentionRegexp } from '../helpers';
|
||||
import { fetchIsAllOrHere, getMentionRegexp } from '../helpers';
|
||||
import { useSubscription, useAutoSaveDraft } from '../hooks';
|
||||
import sharedStyles from '../../../views/Styles';
|
||||
import { useTheme } from '../../../theme';
|
||||
|
@ -24,6 +24,7 @@ import { Services } from '../../../lib/services';
|
|||
import log from '../../../lib/methods/helpers/log';
|
||||
import { useAppSelector, usePrevious } from '../../../lib/hooks';
|
||||
import { ChatsStackParamList } from '../../../stacks/types';
|
||||
import { loadDraftMessage } from '../../../lib/methods/draftMessage';
|
||||
|
||||
const defaultSelection: IInputSelection = { start: 0, end: 0 };
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
export * from './draftMessage';
|
||||
export * from './fetchIsAllOrHere';
|
||||
export * from './forceJpgExtension';
|
||||
export * from './getMentionRegexp';
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { useCallback, useEffect, useRef } from 'react';
|
||||
|
||||
import { saveDraftMessage } from '../helpers';
|
||||
import { useRoomContext } from '../../../views/RoomView/context';
|
||||
import { useFocused } from '../context';
|
||||
import { saveDraftMessage } from '../../../lib/methods/draftMessage';
|
||||
|
||||
export const useAutoSaveDraft = (text = '') => {
|
||||
const { rid, tmid, action, selectedMessages } = useRoomContext();
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import log from '../../../lib/methods/helpers/log';
|
||||
import database from '../../../lib/database';
|
||||
import { getSubscriptionByRoomId } from '../../../lib/database/services/Subscription';
|
||||
import { getThreadById } from '../../../lib/database/services/Thread';
|
||||
import database from '../database';
|
||||
import { getSubscriptionByRoomId } from '../database/services/Subscription';
|
||||
import { getThreadById } from '../database/services/Thread';
|
||||
import log from './helpers/log';
|
||||
|
||||
export const loadDraftMessage = async ({ rid, tmid }: { rid?: string; tmid?: string }): Promise<string> => {
|
||||
if (tmid) {
|
Loading…
Reference in New Issue