@@ -425,7 +425,7 @@ import humanDate from '@/composables/filters/humanDate'
425425import  dayjs  from  ' dayjs' 
426426import  { userRoleHighlight  } from  ' @/composables/utils/userUtils' 
427427import  truncate  from  ' @/composables/filters/truncate' 
428- import  { inject , reactive , watch , toRefs  } from  ' vue' 
428+ import  { inject , reactive , watch , toRefs ,  nextTick  } from  ' vue' 
429429import  { postsApi , pollsApi , threadsApi , usersApi , watchlistApi  } from  ' @/api' 
430430import  { AuthStore  } from  ' @/composables/stores/auth' 
431431import  { PreferencesStore , localStoragePrefs  } from  ' @/composables/stores/prefs' 
@@ -905,7 +905,17 @@ export default {
905905    } 
906906
907907    const  createPost  =  post  =>  postsApi .create (post) 
908-     .then (p  =>  $router .push ({ path:  $route .path , query:  $route .query , hash:  ` #${ p .id } `  
908+     .then (p  =>  { 
909+       const  limit  =  localStoragePrefs ().data .posts_per_page  
910+       if  (v .postData .data .posts .length  ===  limit) { 
911+         const  postCount  =  v .postData .data .thread .post_count  +  1  
912+         const  lastPage  =  Math .ceil (postCount /  limit) 
913+         Object .assign (v .postData .data .thread .post_count , postCount) 
914+         Object .assign (v .postData .data .page , lastPage) 
915+         nextTick (() =>  $router .push ({ path:  $route .path , query:  { ... $route .query , page:  lastPage }, hash:  ` #${ p .id } `  
916+       } 
917+       else  $router .push ({ path:  $route .path , query:  $route .query , hash:  ` #${ p .id } `  
918+     }) 
909919
910920    const  updatePost  =  post  =>  postsApi .update (post) 
911921    .then (processPosts) 
0 commit comments