diff --git a/lib/zin/wg/docapp/js/v1.js b/lib/zin/wg/docapp/js/v1.js index c7f6f9f337..9981c9ef74 100644 --- a/lib/zin/wg/docapp/js/v1.js +++ b/lib/zin/wg/docapp/js/v1.js @@ -1172,11 +1172,11 @@ const commands = const docApp = getDocApp(); if(!docApp.libList.length) return zui.Modal.alert(getLang('createLibFirst')); + const docType = (args && args[1]) || 'doc'; const {spaceType} = docApp; - if(spaceType === 'api') return docApp.startCreateDoc(); + if(spaceType === 'api' || docType === 'api') return docApp.startCreateDoc(); const {spaceID, libID, moduleID} = docApp; - const docType = (args && args[1]) || 'doc'; return showDocBasicModal(args?.[0] ?? 0, 0, true, docType).then((formData) => { zui.Editor.loadModule().then(() => { const emptyDoc = zui.Editor.createEmptyDoc();