clean code, better var names, fix bugs

This commit is contained in:
Tom (plebeius.eth)
2025-01-30 17:27:58 +01:00
parent 204fdfcace
commit 87164fc800
4 changed files with 35 additions and 34 deletions
+5 -5
View File
@@ -17,8 +17,8 @@ const usePublishReply = ({ cid, subplebbitAddress, postCid }: { cid: string; sub
publishCommentOptions: state.publishCommentOptions[parentCid],
}));
const setReplyStore = usePublishReplyStore((state) => state.setReplyStore);
const resetReplyStore = usePublishReplyStore((state) => state.resetReplyStore);
const setPublishReplyStore = usePublishReplyStore((state) => state.setPublishReplyStore);
const resetPublishReplyStore = usePublishReplyStore((state) => state.resetPublishReplyStore);
const createBaseOptions = useCallback(() => {
const baseOptions: Comment = {
@@ -55,12 +55,12 @@ const usePublishReply = ({ cid, subplebbitAddress, postCid }: { cid: string; sub
}, {} as Partial<Comment>);
const newOptions = { ...baseOptions, ...sanitizedOptions };
setReplyStore(newOptions);
setPublishReplyStore(newOptions);
},
[createBaseOptions, setReplyStore],
[createBaseOptions, setPublishReplyStore],
);
const resetPublishReplyOptions = useCallback(() => resetReplyStore(parentCid), [parentCid, resetReplyStore]);
const resetPublishReplyOptions = useCallback(() => resetPublishReplyStore(parentCid), [parentCid, resetPublishReplyStore]);
const { index, publishComment } = usePublishComment(publishCommentOptions);