mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
run prettier
This commit is contained in:
@@ -37,10 +37,13 @@ const usePublishPost = ({ subplebbitAddress }: { subplebbitAddress?: string }) =
|
|||||||
const setPublishPostOptions = useCallback(
|
const setPublishPostOptions = useCallback(
|
||||||
(options: Partial<Comment>) => {
|
(options: Partial<Comment>) => {
|
||||||
const baseOptions = createBaseOptions();
|
const baseOptions = createBaseOptions();
|
||||||
const sanitizedOptions = Object.entries(options).reduce((acc, [key, value]) => {
|
const sanitizedOptions = Object.entries(options).reduce(
|
||||||
|
(acc, [key, value]) => {
|
||||||
acc[key] = value === '' ? undefined : value;
|
acc[key] = value === '' ? undefined : value;
|
||||||
return acc;
|
return acc;
|
||||||
}, {} as Partial<Comment>);
|
},
|
||||||
|
{} as Partial<Comment>,
|
||||||
|
);
|
||||||
|
|
||||||
const newOptions = { ...baseOptions, ...sanitizedOptions };
|
const newOptions = { ...baseOptions, ...sanitizedOptions };
|
||||||
setPublishPostStore(newOptions);
|
setPublishPostStore(newOptions);
|
||||||
|
|||||||
@@ -38,10 +38,13 @@ const usePublishReply = ({ cid, subplebbitAddress, postCid }: { cid: string; sub
|
|||||||
const setPublishReplyOptions = useCallback(
|
const setPublishReplyOptions = useCallback(
|
||||||
(options: Partial<Comment>) => {
|
(options: Partial<Comment>) => {
|
||||||
const baseOptions = createBaseOptions();
|
const baseOptions = createBaseOptions();
|
||||||
const sanitizedOptions = Object.entries(options).reduce((acc, [key, value]) => {
|
const sanitizedOptions = Object.entries(options).reduce(
|
||||||
|
(acc, [key, value]) => {
|
||||||
acc[key] = value === '' ? undefined : value;
|
acc[key] = value === '' ? undefined : value;
|
||||||
return acc;
|
return acc;
|
||||||
}, {} as Partial<Comment>);
|
},
|
||||||
|
{} as Partial<Comment>,
|
||||||
|
);
|
||||||
|
|
||||||
const newOptions = { ...baseOptions, ...sanitizedOptions };
|
const newOptions = { ...baseOptions, ...sanitizedOptions };
|
||||||
setPublishReplyStore(newOptions);
|
setPublishReplyStore(newOptions);
|
||||||
|
|||||||
Reference in New Issue
Block a user