@@ -13,7 +13,9 @@ import {
13
13
EVENT ,
14
14
TYPE ,
15
15
ERR ,
16
+ ROUTE ,
16
17
prettyNum ,
18
+ thread2Subpath ,
17
19
THREAD ,
18
20
cutFrom ,
19
21
errRescue ,
@@ -180,17 +182,29 @@ const initSpecCmdResolver = () => {
180
182
{
181
183
match :SAK . communityLinker ,
182
184
action :cmdpath => {
183
- debug ( 'communityLinker: ' , cmdpath )
185
+ const community = cmdpath [ 0 ]
186
+ const { mainPath, subPath} = store . curRoute
187
+
188
+ if (
189
+ R . contains ( mainPath , [ ROUTE . USER , ROUTE . COMMUNITIES ] ) ||
190
+ R . contains ( subPath , [ ROUTE . POST , ROUTE . JOB , ROUTE . VIDEO , ROUTE . REPO ] )
191
+ ) {
192
+ Global . location . href = `/${ community } /posts`
193
+ return hidePanel ( )
194
+ }
184
195
185
- // Router.push(url, as)
186
- // TODO: use route store method
187
- Router . push (
188
- {
189
- pathname :'/' ,
190
- query :{ main :cmdpath [ 0 ] } ,
191
- } ,
192
- cmdpath [ 0 ]
193
- )
196
+ store . setViewing ( {
197
+ community :{ raw :community } ,
198
+ activeThread :THREAD . POST ,
199
+ post :{ } ,
200
+ } )
201
+
202
+ store . markRoute ( {
203
+ mainPath :community ,
204
+ subPath :thread2Subpath ( THREAD . POST ) ,
205
+ } )
206
+
207
+ dispatchEvent ( EVENT . COMMUNITY_CHANGE )
194
208
hidePanel ( )
195
209
} ,
196
210
} ,
@@ -207,6 +221,8 @@ const doSpecCmd = () => {
207
221
const cmd = store . curCmdChain
208
222
if ( ! cmd ) return
209
223
224
+ debug ( 'doSpecCmd cmd: ' , cmd )
225
+
210
226
/* Do not use forEach, cause forEach will not break */
211
227
for ( let i = 0 ; i < cmdResolver . length ; i += 1 ) {
212
228
if ( cmdResolver [ i ] . match ( cmd ) ) {
@@ -434,7 +450,11 @@ const DataSolver = [
434
450
match :asyncRes ( EVENT . QUERY_DORAMON ) ,
435
451
action :res => {
436
452
const { data} = res [ EVENT . QUERY_DORAMON ]
437
- store . open ( )
453
+ const forcus = false
454
+ store . open ( forcus )
455
+
456
+ /* "doraemonInputbar" */
457
+
438
458
store . markState ( { inputValue :data } )
439
459
queryPocket ( )
440
460
} ,