|
@@ -1,4 +1,7 @@
|
|
|
import { Container } from 'unstated';
|
|
import { Container } from 'unstated';
|
|
|
|
|
+import loggerFactory from '@alias/logger';
|
|
|
|
|
+
|
|
|
|
|
+const logger = loggerFactory('growi:services:NavigationContainer');
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Service container related to options for Application
|
|
* Service container related to options for Application
|
|
@@ -86,6 +89,12 @@ export default class NavigationContainer extends Container {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
setEditorMode(editorMode) {
|
|
setEditorMode(editorMode) {
|
|
|
|
|
+
|
|
|
|
|
+ if (this.appContainer.currentUser == null) {
|
|
|
|
|
+ logger.warn('Please login or signup to edit the page or use hackmd.');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
this.setState({ editorMode });
|
|
this.setState({ editorMode });
|
|
|
if (editorMode === 'view') {
|
|
if (editorMode === 'view') {
|
|
|
$('body').removeClass('on-edit');
|
|
$('body').removeClass('on-edit');
|