@@ -105,6 +105,16 @@ export function setCategory(communityId, categories) {
105105 } )
106106}
107107
108+ export function setTag ( partId , tags ) {
109+ dispatchEvent ( EVENT . NAV_SET_TAG , {
110+ type : TYPE . PREVIEW_SET_TAG ,
111+ data : {
112+ partId,
113+ tags,
114+ } ,
115+ } )
116+ }
117+
108118export function unsetTag ( partId , tag ) {
109119 const args = {
110120 part : R . toUpper ( tag . part ) ,
@@ -147,7 +157,6 @@ const DataSolver = [
147157 {
148158 match : asyncRes ( 'pagedPosts' ) ,
149159 action : ( { pagedPosts } ) => {
150- console . log ( 'pagedPosts --> ' , pagedPosts )
151160 cancleLoading ( )
152161 communitiesContent . markState ( {
153162 pagedPosts,
@@ -187,12 +196,23 @@ const DataSolver = [
187196 match : asyncRes ( EVENT . PREVIEW_CLOSE ) ,
188197 action : res => {
189198 const closeType = res [ EVENT . PREVIEW_CLOSE ] . type
190- if ( closeType === TYPE . COMMUNITIES_REFRESH ) {
191- loadCommunities ( )
192- } else if ( closeType === TYPE . TAGS_REFRESH ) {
193- loadTags ( )
194- } else if ( closeType === TYPE . GATEGORIES_REFRESH ) {
195- loadCategories ( )
199+ switch ( closeType ) {
200+ case TYPE . COMMUNITIES_REFRESH : {
201+ return loadCommunities ( )
202+ }
203+ case TYPE . TAGS_REFRESH : {
204+ return loadTags ( )
205+ }
206+ case TYPE . GATEGORIES_REFRESH : {
207+ return loadCategories ( )
208+ }
209+ case TYPE . POSTS_TAG_REFRESH : {
210+ return loadPosts ( )
211+ }
212+ default : {
213+ debug ( 'unknow event' )
214+ return loadPosts ( )
215+ }
196216 }
197217 } ,
198218 } ,
0 commit comments