|
|
@@ -9,7 +9,7 @@ import { useOnTemplateButtonClicked } from '~/client/services/use-on-template-bu
|
|
|
import { toastError } from '~/client/util/toastr';
|
|
|
import { LabelType } from '~/interfaces/template';
|
|
|
import { useCurrentUser } from '~/stores/context';
|
|
|
-import { useSWRxCurrentPage } from '~/stores/page';
|
|
|
+import { useCurrentPagePath, useSWRxCurrentPage } from '~/stores/page';
|
|
|
|
|
|
import { CreateButton } from './CreateButton';
|
|
|
import { DropendMenu } from './DropendMenu';
|
|
|
@@ -25,6 +25,7 @@ const generateTodaysPath = (currentUser: IUserHasId, parentDirName: string) => {
|
|
|
export const PageCreateButton = React.memo((): JSX.Element => {
|
|
|
const { t } = useTranslation('commons');
|
|
|
|
|
|
+ const { data: currentPagePath, isLoading: isLoadingPagePath } = useCurrentPagePath();
|
|
|
const { data: currentPage, isLoading } = useSWRxCurrentPage();
|
|
|
const { data: currentUser } = useCurrentUser();
|
|
|
|
|
|
@@ -35,8 +36,10 @@ export const PageCreateButton = React.memo((): JSX.Element => {
|
|
|
: generateTodaysPath(currentUser, t('create_page_dropdown.todays.memo'));
|
|
|
|
|
|
const { onClickHandler: onClickNewButton, isPageCreating: isNewPageCreating } = useOnNewButtonClicked(currentPage, isLoading);
|
|
|
+ // TODO: https://redmine.weseek.co.jp/issues/138806
|
|
|
const { onClickHandler: onClickTodaysButton, isPageCreating: isTodaysPageCreating } = useOnTodaysButtonClicked(todaysPath);
|
|
|
- const { onClickHandler: onClickTemplateButton, isPageCreating: isTemplatePageCreating } = useOnTemplateButtonClicked(currentPagePath, isLoading);
|
|
|
+ // TODO: https://redmine.weseek.co.jp/issues/138805
|
|
|
+ const { onClickHandler: onClickTemplateButton, isPageCreating: isTemplatePageCreating } = useOnTemplateButtonClicked(currentPagePath, isLoadingPagePath);
|
|
|
|
|
|
const onClickTemplateButtonHandler = useCallback(async(label: LabelType) => {
|
|
|
try {
|