|
|
@@ -9,7 +9,6 @@ import { pathUtils } from '@growi/core/dist/utils';
|
|
|
import { useTranslation } from 'next-i18next';
|
|
|
|
|
|
import { ValidationTarget } from '~/client/util/input-validator';
|
|
|
-import { basePathname } from '~/server/routes/apiv3/page/create-page';
|
|
|
|
|
|
import ClosableTextInput from '../Common/ClosableTextInput';
|
|
|
import { CopyDropdown } from '../Common/CopyDropdown';
|
|
|
@@ -42,11 +41,9 @@ export const PageTitleHeader: FC<Props> = (props) => {
|
|
|
const editedPageTitle = nodePath.basename(editedPagePath);
|
|
|
|
|
|
// https://regex101.com/r/Wg2Hh6/1
|
|
|
- // const untitledPageRegex = /^Untitled-\d+$/;
|
|
|
+ const untitledPageRegex = /^Untitled-\d+$/;
|
|
|
|
|
|
- const untitledPageRegex = new RegExp(`/^${basePathname}-d+$/`);
|
|
|
-
|
|
|
- const isNewlyCreatedPage = (currentPage.wip && currentPage.ttlTimestamp != null && untitledPageRegex.test(editedPageTitle)) ?? false;
|
|
|
+ const isNewlyCreatedPage = (currentPage.wip && currentPage.latestRevision == null && untitledPageRegex.test(editedPageTitle)) ?? false;
|
|
|
|
|
|
const onRenameFinish = useCallback(() => {
|
|
|
setRenameInputShown(false);
|