| 
									
										
										
										
											2018-08-28 06:44:36 -07:00
										 |  |  | {#if pinnedStatuses.length } | 
					
						
							|  |  |  |   <h1 class="sr-only">Pinned statuses</h1> | 
					
						
							|  |  |  |   <div role="feed" aria-label="Pinned statuses" class="pinned-statuses"> | 
					
						
							|  |  |  |     {#each pinnedStatuses as status, index (status.id)} | 
					
						
							|  |  |  |       <Status {status} | 
					
						
							|  |  |  |               timelineType="pinned" | 
					
						
							|  |  |  |               timelineValue={accountId} | 
					
						
							|  |  |  |               {index} | 
					
						
							|  |  |  |               length={pinnedStatuses.length} | 
					
						
							|  |  |  |       /> | 
					
						
							|  |  |  |     {/each} | 
					
						
							|  |  |  |   </div> | 
					
						
							|  |  |  | {/if} | 
					
						
							| 
									
										
										
										
											2018-02-11 10:35:25 -08:00
										 |  |  | <script> | 
					
						
							|  |  |  |   import { store } from '../../_store/store' | 
					
						
							|  |  |  |   import Status from '../status/Status.html' | 
					
						
							|  |  |  |   import { updatePinnedStatusesForAccount } from '../../_actions/pinnedStatuses' | 
					
						
							| 
									
										
										
										
											2018-04-29 12:28:44 -07:00
										 |  |  |   import { on } from '../../_utils/eventBus' | 
					
						
							| 
									
										
										
										
											2018-02-11 10:35:25 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   export default { | 
					
						
							| 
									
										
										
										
											2018-04-19 21:38:01 -07:00
										 |  |  |     async oncreate () { | 
					
						
							| 
									
										
										
										
											2018-04-29 12:28:44 -07:00
										 |  |  |       on('updatePinnedStatuses', this, () => this.updatePinnedStatuses()) | 
					
						
							|  |  |  |       await this.updatePinnedStatuses() | 
					
						
							| 
									
										
										
										
											2018-02-11 10:35:25 -08:00
										 |  |  |     }, | 
					
						
							|  |  |  |     computed: { | 
					
						
							| 
									
										
										
										
											2018-05-01 17:05:36 -07:00
										 |  |  |       pinnedStatuses: ({ $pinnedStatuses, $currentInstance, accountId }) => { | 
					
						
							| 
									
										
										
										
											2018-04-29 12:28:44 -07:00
										 |  |  |         return ($pinnedStatuses[$currentInstance] && $pinnedStatuses[$currentInstance][accountId]) || [] | 
					
						
							| 
									
										
										
										
											2018-02-11 10:35:25 -08:00
										 |  |  |       } | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  |     store: () => store, | 
					
						
							|  |  |  |     components: { | 
					
						
							| 
									
										
										
										
											2018-02-11 23:10:07 -08:00
										 |  |  |       Status | 
					
						
							| 
									
										
										
										
											2018-04-29 12:28:44 -07:00
										 |  |  |     }, | 
					
						
							|  |  |  |     methods: { | 
					
						
							|  |  |  |       async updatePinnedStatuses () { | 
					
						
							|  |  |  |         let { accountId } = this.get() | 
					
						
							|  |  |  |         await updatePinnedStatusesForAccount(accountId) | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2018-02-11 10:35:25 -08:00
										 |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | </script> |