tests i can't run locally for now

Signed-off-by: marcin mikolajczak <git@mkljczk.pl>
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikolajczak
2022-09-14 22:05:40 +02:00
committed by marcin mikołajczak
parent 6cce0a0291
commit b38e5ec8e3
13 changed files with 571 additions and 531 deletions

View File

@ -149,19 +149,19 @@ const ComposeForm: React.FC<IComposeForm> = ({ id, shouldCondense, autoFocus, cl
};
const onSuggestionsClearRequested = () => {
dispatch(clearComposeSuggestions());
dispatch(clearComposeSuggestions(id));
};
const onSuggestionsFetchRequested = (token: string | number) => {
dispatch(fetchComposeSuggestions(token as string));
dispatch(fetchComposeSuggestions(id, token as string));
};
const onSuggestionSelected = (tokenStart: number, token: string | null, value: string | undefined) => {
if (value) dispatch(selectComposeSuggestion(tokenStart, token, value, ['text']));
if (value) dispatch(selectComposeSuggestion(id, tokenStart, token, value, ['text']));
};
const onSpoilerSuggestionSelected = (tokenStart: number, token: string | null, value: AutoSuggestion) => {
dispatch(selectComposeSuggestion(tokenStart, token, value, ['spoiler_text']));
dispatch(selectComposeSuggestion(id, tokenStart, token, value, ['spoiler_text']));
};
const handleChangeSpoilerText: React.ChangeEventHandler<HTMLInputElement> = (e) => {

View File

@ -115,7 +115,6 @@ const EmojiPickerDropdown: React.FC<IEmojiPickerDropdown> = ({ onPickEmoji, butt
};
const handlePickEmoji = (emoji: EmojiType) => {
console.log(emoji);
// eslint-disable-next-line react-hooks/rules-of-hooks
dispatch(useEmoji(emoji));

View File

@ -61,13 +61,13 @@ const Option: React.FC<IOption> = ({
}
};
const onSuggestionsClearRequested = () => dispatch(clearComposeSuggestions());
const onSuggestionsClearRequested = () => dispatch(clearComposeSuggestions(composeId));
const onSuggestionsFetchRequested = (token: string) => dispatch(fetchComposeSuggestions(token));
const onSuggestionsFetchRequested = (token: string) => dispatch(fetchComposeSuggestions(composeId, token));
const onSuggestionSelected = (tokenStart: number, token: string | null, value: AutoSuggestion) => {
if (token && typeof token === 'string') {
dispatch(selectComposeSuggestion(tokenStart, token, value, ['poll', 'options', index]));
dispatch(selectComposeSuggestion(composeId, tokenStart, token, value, ['poll', 'options', index]));
}
};

View File

@ -22,8 +22,8 @@ const ScheduleButton: React.FC<IScheduleButton> = ({ composeId, disabled }) => {
const compose = useCompose(composeId);
const active = compose.schedule;
const unavailable = compose.id;
const active = !!compose.schedule;
const unavailable = !!compose.id;
const handleClick = () => {
if (active) {

View File

@ -91,7 +91,7 @@ const Upload: React.FC<IUpload> = ({ composeId, id }) => {
const handleUndoClick: React.MouseEventHandler = e => {
e.stopPropagation();
dispatch(undoUploadCompose(media.id));
dispatch(undoUploadCompose(composeId, media.id));
};
const handleInputChange: React.ChangeEventHandler<HTMLTextAreaElement> = e => {
@ -119,7 +119,7 @@ const Upload: React.FC<IUpload> = ({ composeId, id }) => {
setDirtyDescription(null);
if (dirtyDescription !== null) {
dispatch(changeUploadCompose(media.id, { dirtyDescription }));
dispatch(changeUploadCompose(composeId, media.id, { dirtyDescription }));
}
};