|
|
@@ -52,6 +52,9 @@ export default class NavigationContainer extends Container {
|
|
|
return 'NavigationContainer';
|
|
|
}
|
|
|
|
|
|
+ getPageContainer() {
|
|
|
+ return this.appContainer.getContainer('PageContainer');
|
|
|
+ }
|
|
|
|
|
|
initDeviceSize() {
|
|
|
const mdOrAvobeHandler = async(mql) => {
|
|
|
@@ -89,12 +92,18 @@ export default class NavigationContainer extends Container {
|
|
|
}
|
|
|
|
|
|
setEditorMode(editorMode) {
|
|
|
+ const { isNotCreatable } = this.getPageContainer().state;
|
|
|
|
|
|
if (this.appContainer.currentUser == null) {
|
|
|
logger.warn('Please login or signup to edit the page or use hackmd.');
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ if (isNotCreatable) {
|
|
|
+ logger.warn('This page could not edit.');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
this.setState({ editorMode });
|
|
|
if (editorMode === 'view') {
|
|
|
$('body').removeClass('on-edit');
|