Shun Miyazawa 7 месяцев назад
Родитель
Сommit
3ffbcc9439

+ 2 - 2
apps/app/src/client/components/LoginForm/LoginForm.tsx

@@ -89,7 +89,7 @@ export const LoginForm = (props: LoginFormProps): JSX.Element => {
     setLoginErrors([]);
   }, [loginErrors.length]);
 
-  const handleLoginWithLocalSubmit = useCallback(async (e) => {
+  const handleLoginWithLocalSubmit = useCallback(async(e) => {
     e.preventDefault();
     resetLoginErrors();
     setIsLoading(true);
@@ -279,7 +279,7 @@ export const LoginForm = (props: LoginFormProps): JSX.Element => {
     setRegisterErrors([]);
   }, [registerErrors.length]);
 
-  const handleRegisterFormSubmit = useCallback(async (e, requestPath) => {
+  const handleRegisterFormSubmit = useCallback(async(e, requestPath) => {
     e.preventDefault();
     setEmailForRegistrationOrder('');
     setIsSuccessToRagistration(false);

+ 3 - 3
apps/app/src/client/components/PageComment/CommentEditor.tsx

@@ -135,7 +135,7 @@ export const CommentEditor = (props: CommentEditorProps): JSX.Element => {
     setSlackChannels(slackChannels);
   }, []);
 
-  const initializeEditor = useCallback(async () => {
+  const initializeEditor = useCallback(async() => {
     const dirtyNum = await cleanEditorDirtyMap(editorKey);
     mutateIsEnabledUnsavedWarning(dirtyNum > 0);
 
@@ -151,7 +151,7 @@ export const CommentEditor = (props: CommentEditorProps): JSX.Element => {
     onCanceled?.();
   }, [onCanceled, initializeEditor]);
 
-  const postCommentHandler = useCallback(async () => {
+  const postCommentHandler = useCallback(async() => {
     const commentBodyToPost = codeMirrorEditor?.getDocString() ?? '';
 
     try {
@@ -209,7 +209,7 @@ export const CommentEditor = (props: CommentEditorProps): JSX.Element => {
   }, [codeMirrorEditor, pageId]);
 
   const cmProps = useMemo(() => ({
-    onChange: async (value: string) => {
+    onChange: async(value: string) => {
       const dirtyNum = await evaluateEditorDirtyMap(editorKey, value);
       mutateIsEnabledUnsavedWarning(dirtyNum > 0);
     },

+ 1 - 1
apps/app/src/client/components/PageEditor/EditorNavbarBottom/SavePageControls.tsx

@@ -49,7 +49,7 @@ const SavePageButton = (props: { slackChannels: string, isSlackEnabled?: boolean
 
   const isWaitingSaveProcessing = _isWaitingSaveProcessing === true; // ignore undefined
 
-  const save = useCallback(async (): Promise<void> => {
+  const save = useCallback(async(): Promise<void> => {
     // save
     globalEmitter.emit('saveAndReturnToView', { wip: false, slackChannels, isSlackEnabled });
   }, [isSlackEnabled, slackChannels]);

+ 3 - 3
apps/app/src/client/components/PageEditor/PageEditor.tsx

@@ -167,7 +167,7 @@ export const PageEditorSubstance = (props: Props): JSX.Element => {
   const scrollEditorHandlerThrottle = useMemo(() => throttle(25, scrollEditorHandler), [scrollEditorHandler]);
   const scrollPreviewHandlerThrottle = useMemo(() => throttle(25, scrollPreviewHandler), [scrollPreviewHandler]);
 
-  const save: Save = useCallback(async (revisionId, markdown, opts, onConflict) => {
+  const save: Save = useCallback(async(revisionId, markdown, opts, onConflict) => {
     if (pageId == null || selectedGrant == null) {
       logger.error('Some materials to save are invalid', {
         pageId, selectedGrant,
@@ -216,7 +216,7 @@ export const PageEditorSubstance = (props: Props): JSX.Element => {
     }
   }, [pageId, selectedGrant, mutateWaitingSaveProcessing, updatePage, mutateIsGrantNormalized, t]);
 
-  const saveAndReturnToViewHandler = useCallback(async (opts: SaveOptions) => {
+  const saveAndReturnToViewHandler = useCallback(async(opts: SaveOptions) => {
     const markdown = codeMirrorEditor?.getDocString();
     const revisionId = isRevisionIdRequiredForPageUpdate ? currentRevisionId : undefined;
     const page = await save(revisionId, markdown, opts, onConflict);
@@ -228,7 +228,7 @@ export const PageEditorSubstance = (props: Props): JSX.Element => {
     updateStateAfterSave?.();
   }, [codeMirrorEditor, currentRevisionId, isRevisionIdRequiredForPageUpdate, mutateEditorMode, onConflict, save, updateStateAfterSave]);
 
-  const saveWithShortcut = useCallback(async () => {
+  const saveWithShortcut = useCallback(async() => {
     const markdown = codeMirrorEditor?.getDocString();
     const revisionId = isRevisionIdRequiredForPageUpdate ? currentRevisionId : undefined;
     const page = await save(revisionId, markdown, undefined, onConflict);

+ 3 - 3
apps/app/src/client/components/SearchPage/SearchPageBase.tsx

@@ -236,9 +236,9 @@ const SearchPageBaseSubstance: ForwardRefRenderFunction<ISelectableAll & IReturn
 type VoidFunction = () => void;
 
 export const usePageDeleteModalForBulkDeletion = (
-  data: IFormattedSearchResult | undefined,
-  ref: React.MutableRefObject<(ISelectableAll & IReturnSelectedPageIds) | null>,
-  onDeleted?: OnDeletedFunction,
+    data: IFormattedSearchResult | undefined,
+    ref: React.MutableRefObject<(ISelectableAll & IReturnSelectedPageIds) | null>,
+    onDeleted?: OnDeletedFunction,
 ): VoidFunction => {
 
   const { t } = useTranslation();

+ 12 - 12
apps/app/src/stores/page.tsx

@@ -196,9 +196,9 @@ export const mutateAllPageInfo = (): Promise<void[]> => {
 };
 
 export const useSWRxPageInfo = (
-  pageId: string | null | undefined,
-  shareLinkId?: string | null,
-  initialData?: IPageInfoForEntity,
+    pageId: string | null | undefined,
+    shareLinkId?: string | null,
+    initialData?: IPageInfoForEntity,
 ): SWRResponse<IPageInfo | IPageInfoForOperation> => {
 
   // Cache remains from guest mode when logging in via the Login lead, so add 'isGuestUser' key
@@ -231,8 +231,8 @@ export const useSWRxPageInfo = (
 };
 
 export const useSWRMUTxPageInfo = (
-  pageId: string | null | undefined,
-  shareLinkId?: string | null,
+    pageId: string | null | undefined,
+    shareLinkId?: string | null,
 ): SWRMutationResponse<IPageInfo | IPageInfoForOperation> => {
 
   // Cache remains from guest mode when logging in via the Login lead, so add 'isGuestUser' key
@@ -264,8 +264,8 @@ export const useSWRxPageRevision = (pageId: string, revisionId: Ref<IRevision>):
  */
 
 export const useSWRxInfinitePageRevisions = (
-  pageId: string,
-  limit: number,
+    pageId: string,
+    limit: number,
 ): SWRInfiniteResponse<SWRInfinitePageRevisionsResponse, Error> => {
   return useSWRInfinite(
     (pageIndex, previousRevisionData) => {
@@ -289,7 +289,7 @@ export const useSWRxInfinitePageRevisions = (
  * Grant data fetching hooks
  */
 export const useSWRxCurrentGrantData = (
-  pageId: string | null | undefined,
+    pageId: string | null | undefined,
 ): SWRResponse<IResCurrentGrantData, Error> => {
 
   const { data: isGuestUser } = useIsGuestUser();
@@ -307,7 +307,7 @@ export const useSWRxCurrentGrantData = (
 };
 
 export const useSWRxApplicableGrant = (
-  pageId: string | null | undefined,
+    pageId: string | null | undefined,
 ): SWRResponse<IRecordApplicableGrant, Error> => {
 
   return useSWR(
@@ -366,14 +366,14 @@ export const useIsRevisionOutdated = (): SWRResponse<boolean, Error> => {
 
 
 export const useSWRxPagePathsWithDescendantCount = (
-  paths?: string[], userGroups?: string[], isIncludeEmpty?: boolean, includeAnyoneWithTheLink?: boolean,
+    paths?: string[], userGroups?: string[], isIncludeEmpty?: boolean, includeAnyoneWithTheLink?: boolean,
 ): SWRResponse<IPagePathWithDescendantCount[], Error> => {
   return useSWR(
     (paths != null && paths.length !== 0) ? ['/page/page-paths-with-descendant-count', paths, userGroups, isIncludeEmpty, includeAnyoneWithTheLink] : null,
     ([endpoint, paths, userGroups, isIncludeEmpty, includeAnyoneWithTheLink]) => apiv3Get(
       endpoint, {
-      paths, userGroups, isIncludeEmpty, includeAnyoneWithTheLink,
-    },
+        paths, userGroups, isIncludeEmpty, includeAnyoneWithTheLink,
+      },
     ).then(result => result.data.pagePathsWithDescendantCount),
   );
 };

+ 1 - 1
apps/app/src/stores/websocket.tsx

@@ -26,7 +26,7 @@ export const useSetupGlobalSocket = (): void => {
       return;
     }
 
-    mutate(async () => {
+    mutate(async() => {
       const { io } = await import('socket.io-client');
       const socket = io(GLOBAL_SOCKET_NS, {
         transports: ['websocket'],