@@ -24,6 +24,7 @@ const sr71$ = new SR71({
2424 EVENT . REFRESH_JOBS ,
2525 EVENT . PREVIEW_CLOSED ,
2626 EVENT . COMMUNITY_CHANGE ,
27+ EVENT . TABBER_CHANGE ,
2728 ] ,
2829} )
2930/* eslint-disable no-unused-vars */
@@ -33,12 +34,7 @@ const debug = makeDebugger('L:JobsThread')
3334let store = null
3435let sub$ = null
3536
36- const validFilter = R . pickBy (
37- R . compose (
38- R . not ,
39- R . isEmpty
40- )
41- )
37+ const validFilter = R . pickBy ( R . compose ( R . not , R . isEmpty ) )
4238
4339export const inAnchor = ( ) => store . setHeaderFix ( false )
4440export const outAnchor = ( ) => store . setHeaderFix ( true )
@@ -103,6 +99,7 @@ const DataSolver = [
10399 {
104100 match : asyncRes ( 'pagedJobs' ) ,
105101 action : ( { pagedJobs } ) => {
102+ debug ( 'pagedJobs --> ' , pagedJobs )
106103 let curView = TYPE . RESULT
107104 if ( pagedJobs . entries . length === 0 ) {
108105 curView = TYPE . RESULT_EMPTY
@@ -118,6 +115,10 @@ const DataSolver = [
118115 match : asyncRes ( EVENT . COMMUNITY_CHANGE ) ,
119116 action : ( ) => loadJobs ( ) ,
120117 } ,
118+ {
119+ match : asyncRes ( EVENT . TABBER_CHANGE ) ,
120+ action : ( ) => loadJobs ( ) ,
121+ } ,
121122 {
122123 match : asyncRes ( EVENT . REFRESH_JOBS ) ,
123124 action : ( ) => loadJobs ( ) ,
@@ -150,14 +151,12 @@ const ErrSolver = [
150151]
151152
152153export function init ( _store ) {
153- if ( store ) {
154- return false // loadIfNeed()
155- }
156154 store = _store
157155
158156 if ( sub$ ) sub$ . unsubscribe ( )
159157 sub$ = sr71$ . data ( ) . subscribe ( $solver ( DataSolver , ErrSolver ) )
158+ }
160159
161- // loadIfNeed()
162- /* loadJobs() */
160+ export function uninit ( ) {
161+ if ( sub$ ) sub$ . unsubscribe ( )
163162}
0 commit comments