kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
actions: useEmoji --> chooseEmoji
rodzic
0b0a548f8c
commit
cdda5363f6
|
@ -13,7 +13,7 @@ import toast from 'soapbox/toast';
|
|||
import { isLoggedIn } from 'soapbox/utils/auth';
|
||||
import { getFeatures, parseVersion } from 'soapbox/utils/features';
|
||||
|
||||
import { useEmoji } from './emojis';
|
||||
import { chooseEmoji } from './emojis';
|
||||
import { importFetchedAccounts } from './importer';
|
||||
import { uploadFile, updateMedia } from './media';
|
||||
import { openModal, closeModal } from './modals';
|
||||
|
@ -631,7 +631,7 @@ const selectComposeSuggestion = (composeId: string, position: number, token: str
|
|||
completion = isNativeEmoji(suggestion) ? suggestion.native : suggestion.colons;
|
||||
startPosition = position - 1;
|
||||
|
||||
dispatch(useEmoji(suggestion));
|
||||
dispatch(chooseEmoji(suggestion));
|
||||
} else if (typeof suggestion === 'string' && suggestion[0] === '#') {
|
||||
completion = suggestion;
|
||||
startPosition = position - 1;
|
||||
|
|
|
@ -3,12 +3,12 @@ import { saveSettings } from './settings';
|
|||
import type { Emoji } from 'soapbox/features/emoji';
|
||||
import type { AppDispatch } from 'soapbox/store';
|
||||
|
||||
const EMOJI_USE = 'EMOJI_USE';
|
||||
const EMOJI_CHOOSE = 'EMOJI_CHOOSE';
|
||||
|
||||
const useEmoji = (emoji: Emoji) =>
|
||||
const chooseEmoji = (emoji: Emoji) =>
|
||||
(dispatch: AppDispatch) => {
|
||||
dispatch({
|
||||
type: EMOJI_USE,
|
||||
type: EMOJI_CHOOSE,
|
||||
emoji,
|
||||
});
|
||||
|
||||
|
@ -16,6 +16,6 @@ const useEmoji = (emoji: Emoji) =>
|
|||
};
|
||||
|
||||
export {
|
||||
EMOJI_USE,
|
||||
useEmoji,
|
||||
EMOJI_CHOOSE,
|
||||
chooseEmoji,
|
||||
};
|
||||
|
|
|
@ -33,7 +33,7 @@ import React, {
|
|||
import ReactDOM from 'react-dom';
|
||||
|
||||
import { clearComposeSuggestions, fetchComposeSuggestions } from 'soapbox/actions/compose';
|
||||
import { useEmoji as chooseEmoji } from 'soapbox/actions/emojis';
|
||||
import { chooseEmoji } from 'soapbox/actions/emojis';
|
||||
import AutosuggestEmoji from 'soapbox/components/autosuggest-emoji';
|
||||
import { useAppDispatch, useCompose } from 'soapbox/hooks';
|
||||
import { selectAccount } from 'soapbox/selectors';
|
||||
|
|
|
@ -3,7 +3,7 @@ import React, { useEffect, useState, useLayoutEffect } from 'react';
|
|||
import { defineMessages, useIntl } from 'react-intl';
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
import { useEmoji } from 'soapbox/actions/emojis';
|
||||
import { chooseEmoji } from 'soapbox/actions/emojis';
|
||||
import { changeSetting } from 'soapbox/actions/settings';
|
||||
import { useAppDispatch, useAppSelector, useTheme } from 'soapbox/hooks';
|
||||
import { RootState } from 'soapbox/store';
|
||||
|
@ -160,7 +160,7 @@ const EmojiPickerDropdown: React.FC<IEmojiPickerDropdown> = ({
|
|||
} as CustomEmoji;
|
||||
}
|
||||
|
||||
dispatch(useEmoji(pickedEmoji)); // eslint-disable-line react-hooks/rules-of-hooks
|
||||
dispatch(chooseEmoji(pickedEmoji));
|
||||
|
||||
if (onPickEmoji) {
|
||||
onPickEmoji(pickedEmoji);
|
||||
|
|
|
@ -3,7 +3,7 @@ import { AnyAction } from 'redux';
|
|||
|
||||
import { ME_FETCH_SUCCESS } from 'soapbox/actions/me';
|
||||
|
||||
import { EMOJI_USE } from '../actions/emojis';
|
||||
import { EMOJI_CHOOSE } from '../actions/emojis';
|
||||
import { NOTIFICATIONS_FILTER_SET } from '../actions/notifications';
|
||||
import { SEARCH_FILTER_SET } from '../actions/search';
|
||||
import {
|
||||
|
@ -40,7 +40,7 @@ export default function settings(state: State = ImmutableMap<string, any>({ save
|
|||
return state
|
||||
.setIn(action.path, action.value)
|
||||
.set('saved', false);
|
||||
case EMOJI_USE:
|
||||
case EMOJI_CHOOSE:
|
||||
return updateFrequentEmojis(state, action.emoji);
|
||||
case SETTING_SAVE:
|
||||
return state.set('saved', true);
|
||||
|
|
Ładowanie…
Reference in New Issue