File tree Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Expand file tree Collapse file tree 3 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,14 @@ export default function useFetchPost() {
1010
1111 function fetchPost ( id ) {
1212 const cachedPosts = StorageService . get ( "cached-posts" ) || { } ;
13- if ( cachedPosts [ `post-${ id } ` ] ) return cachedPosts [ `post-${ id } ` ] ;
14- startLoading ( ) ;
15- return PostsServices . getOneById ( id )
13+
14+ if ( cachedPosts [ `post-${ id } ` ] ) {
15+ post . value = cachedPosts [ `post-${ id } ` ] ;
16+ return
17+ }
18+ else {
19+ startLoading ( ) ;
20+ return PostsServices . getOneById ( id )
1621 . then ( ( response ) => {
1722 post . value = response . data ;
1823 StorageService . set ( 'cached-posts' , { ...cachedPosts , [ `post-${ id } ` ] : response . data } )
@@ -21,6 +26,7 @@ export default function useFetchPost() {
2126 . finally ( ( ) => {
2227 endLoading ( ) ;
2328 } ) ;
29+ }
2430 }
2531
2632 return {
Original file line number Diff line number Diff line change @@ -41,5 +41,7 @@ export default {
4141 "System" : "System" ,
4242 "Settings" : "Settings" ,
4343 "Actions" :"Actions" ,
44- "EmailPlaceholder" :"Email"
44+ "EmailPlaceholder" :"Email" ,
45+ "Post" :"Post" ,
46+ "Confirmed" :"Confirmed"
4547} ;
Original file line number Diff line number Diff line change @@ -43,4 +43,5 @@ export default {
4343 Settings : "تنظیمات" ,
4444 Actions : "عملیات" ,
4545 EmailPlaceholder : "Email" ,
46+ "Confirmed" :"تایید شده"
4647} ;
You can’t perform that action at this time.
0 commit comments