File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
src/components/EditorRoadmap Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ import { useToast } from '../../hooks/use-toast';
1212import type { Edge , Node } from 'reactflow' ;
1313import { Renderer } from '../../../editor/renderer' ;
1414import { slugify } from '../../lib/slugger' ;
15+ import { isLoggedIn } from '../../lib/jwt' ;
16+ import { showLoginPopup } from '../../lib/popup' ;
1517
1618export type RoadmapRendererProps = {
1719 resourceId : string ;
@@ -104,13 +106,23 @@ export function EditorRoadmapRenderer(props: RoadmapRendererProps) {
104106
105107 if ( e . shiftKey ) {
106108 e . preventDefault ( ) ;
109+ if ( ! isLoggedIn ( ) ) {
110+ showLoginPopup ( ) ;
111+ return ;
112+ }
113+
107114 updateTopicStatus (
108115 nodeId ,
109116 isCurrentStatusLearning ? 'pending' : 'learning' ,
110117 ) ;
111118 return ;
112119 } else if ( e . altKey ) {
113120 e . preventDefault ( ) ;
121+ if ( ! isLoggedIn ( ) ) {
122+ showLoginPopup ( ) ;
123+ return ;
124+ }
125+
114126 updateTopicStatus ( nodeId , isCurrentStatusSkipped ? 'pending' : 'skipped' ) ;
115127 return ;
116128 }
@@ -143,6 +155,10 @@ export function EditorRoadmapRenderer(props: RoadmapRendererProps) {
143155 return ;
144156 }
145157
158+ if ( ! isLoggedIn ( ) ) {
159+ showLoginPopup ( ) ;
160+ return ;
161+ }
146162 const isCurrentStatusDone = targetGroup ?. classList . contains ( 'done' ) ;
147163 updateTopicStatus ( nodeId , isCurrentStatusDone ? 'pending' : 'done' ) ;
148164 } , [ ] ) ;
You can’t perform that action at this time.
0 commit comments