mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
run prettier
This commit is contained in:
@@ -36,8 +36,8 @@ const useIsSubplebbitOffline = (subplebbit: Subplebbit) => {
|
|||||||
const offlineTitle = isLoading
|
const offlineTitle = isLoading
|
||||||
? 'downloading board...'
|
? 'downloading board...'
|
||||||
: updatedAt
|
: updatedAt
|
||||||
? isOffline && t('posts_last_synced_info', { time: getFormattedTimeAgo(updatedAt), interpolation: { escapeValue: false } })
|
? isOffline && t('posts_last_synced_info', { time: getFormattedTimeAgo(updatedAt), interpolation: { escapeValue: false } })
|
||||||
: t('subplebbit_offline_info');
|
: t('subplebbit_offline_info');
|
||||||
|
|
||||||
return { isOffline: !isOnline && isOffline, isOnlineStatusLoading: !isOnline && isLoading, offlineIconClass, offlineTitle };
|
return { isOffline: !isOnline && isOffline, isOnlineStatusLoading: !isOnline && isLoading, offlineIconClass, offlineTitle };
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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 === '' ? undefined : value;
|
(acc, [key, value]) => {
|
||||||
return acc;
|
acc[key] = value === '' ? undefined : value;
|
||||||
}, {} as Partial<Comment>);
|
return acc;
|
||||||
|
},
|
||||||
|
{} 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 === '' ? undefined : value;
|
(acc, [key, value]) => {
|
||||||
return acc;
|
acc[key] = value === '' ? undefined : value;
|
||||||
}, {} as Partial<Comment>);
|
return acc;
|
||||||
|
},
|
||||||
|
{} as Partial<Comment>,
|
||||||
|
);
|
||||||
|
|
||||||
const newOptions = { ...baseOptions, ...sanitizedOptions };
|
const newOptions = { ...baseOptions, ...sanitizedOptions };
|
||||||
setPublishReplyStore(newOptions);
|
setPublishReplyStore(newOptions);
|
||||||
|
|||||||
Reference in New Issue
Block a user