@@ -5,7 +5,7 @@ import urls from 'kolibri.urls';
55import { ContentNodeResource } from 'kolibri.resources' ;
66import { PageNames } from '../../constants' ;
77import { getAppNameByID , getChannelIcon } from '../../customApps' ;
8- import { normalizeContentNode , contentState } from '../coreExplore/utils' ;
8+ import { normalizeContentNode } from '../coreExplore/utils' ;
99
1010function _getAppMetadata ( appName ) {
1111 const url = urls [ 'kolibri:kolibri_explore_plugin:app_metadata' ] ( { app : appName } ) ;
@@ -127,38 +127,14 @@ export function showTopicsChannel(store, id) {
127127 } ) ;
128128}
129129
130- export function showTopicsContentInLightbox ( store , id ) {
131- const promises = [ ContentNodeResource . fetchModel ( { id } ) , store . dispatch ( 'setChannelInfo' ) ] ;
132- const shouldResolve = samePageCheckGenerator ( store ) ;
133- Promise . all ( promises ) . then (
134- ( [ content ] ) => {
135- if ( shouldResolve ( ) ) {
136- const currentChannel = store . getters . getChannelObject ( content . channel_id ) ;
137- if ( ! currentChannel ) {
138- router . replace ( { name : PageNames . CONTENT_UNAVAILABLE } ) ;
139- return ;
140- }
141- store . commit ( 'topicsTree/SET_STATE' , {
142- content : contentState ( content ) ,
143- channel : currentChannel ,
144- } ) ;
145-
146- const appName = getAppNameByID ( content . channel_id ) ;
147- if ( appName ) {
148- _getAppMetadata ( appName )
149- . then ( ( { data } ) => {
150- store . commit ( 'topicsTree/SET_APP_METADATA' , _parseAppMetadata ( data , appName ) ) ;
151- } )
152- . catch ( ( ) => {
153- console . log ( `no metadata ${ appName } ` ) ;
154- } ) ;
155- }
156- }
157- } ,
158- error => {
159- shouldResolve ( ) ? store . dispatch ( 'handleApiError' , error ) : null ;
160- }
161- ) ;
130+ export function showTopicsContentInLightbox ( _store , id ) {
131+ const learnUrl = urls [ 'kolibri:kolibri.plugins.learn:learn' ] ;
132+ if ( learnUrl ) {
133+ const prevName = encodeURIComponent ( window . location . href ) ;
134+ const contentViewerUrl = `${ learnUrl ( ) } #/topics/c/${ id } ?prevName=${ prevName } ` ;
135+ window . location . replace ( contentViewerUrl ) ;
136+ return ;
137+ }
162138}
163139
164140export function hideTopicsContentFromLightbox ( store ) {
0 commit comments