|
|
@@ -13,6 +13,7 @@ import { debounce } from 'throttle-debounce';
|
|
|
import { toastError } from '~/client/util/apiNotification';
|
|
|
import { useCurrentUser, useIsSearchServiceReachable } from '~/stores/context';
|
|
|
import { usePageCreateModal } from '~/stores/modal';
|
|
|
+import { EditorMode, useEditorMode } from '~/stores/ui';
|
|
|
|
|
|
import PagePathAutoComplete from './PagePathAutoComplete';
|
|
|
|
|
|
@@ -36,6 +37,8 @@ const PageCreateModal = () => {
|
|
|
const pageNameInputInitialValue = isCreatable ? pathUtils.addTrailingSlash(pathname) : '/';
|
|
|
const now = format(new Date(), 'yyyy/MM/dd');
|
|
|
|
|
|
+ const { mutate: mutateEditorMode } = useEditorMode();
|
|
|
+
|
|
|
const [todayInput1, setTodayInput1] = useState(t('Memo'));
|
|
|
const [todayInput2, setTodayInput2] = useState('');
|
|
|
const [pageNameInput, setPageNameInput] = useState(pageNameInputInitialValue);
|
|
|
@@ -99,8 +102,9 @@ const PageCreateModal = () => {
|
|
|
*/
|
|
|
async function redirectToEditor(...paths) {
|
|
|
try {
|
|
|
- const editorPath = await generateEditorPath(...paths);
|
|
|
- router.push(editorPath);
|
|
|
+ const editorPath = generateEditorPath(...paths);
|
|
|
+ await router.push(editorPath);
|
|
|
+ mutateEditorMode(EditorMode.Editor);
|
|
|
|
|
|
// close modal
|
|
|
closeCreateModal();
|