Add ability to filter quote posts in home timeline (#34946)
This commit is contained in:
		
					parent
					
						
							
								3d474807bf
							
						
					
				
			
			
				commit
				
					
						520974e052
					
				
			
		
					 4 changed files with 24 additions and 6 deletions
				
			
		|  | @ -40,6 +40,19 @@ export const ColumnSettings: React.FC = () => { | |||
|             } | ||||
|           /> | ||||
| 
 | ||||
|           <SettingToggle | ||||
|             prefix='home_timeline' | ||||
|             settings={settings} | ||||
|             settingPath={['shows', 'quote']} | ||||
|             onChange={onChange} | ||||
|             label={ | ||||
|               <FormattedMessage | ||||
|                 id='home.column_settings.show_quotes' | ||||
|                 defaultMessage='Show quotes' | ||||
|               /> | ||||
|             } | ||||
|           /> | ||||
| 
 | ||||
|           <SettingToggle | ||||
|             prefix='home_timeline' | ||||
|             settings={settings} | ||||
|  |  | |||
|  | @ -17,19 +17,22 @@ const makeGetStatusIds = (pending = false) => createSelector([ | |||
|     if (id === null || id === 'inline-follow-suggestions') return true; | ||||
| 
 | ||||
|     const statusForId = statuses.get(id); | ||||
|     let showStatus    = true; | ||||
| 
 | ||||
|     if (statusForId.get('account') === me) return true; | ||||
| 
 | ||||
|     if (columnSettings.getIn(['shows', 'reblog']) === false) { | ||||
|       showStatus = showStatus && statusForId.get('reblog') === null; | ||||
|     if (columnSettings.getIn(['shows', 'reblog']) === false && statusForId.get('reblog') !== null) { | ||||
|       return false; | ||||
|     } | ||||
| 
 | ||||
|     if (columnSettings.getIn(['shows', 'reply']) === false) { | ||||
|       showStatus = showStatus && (statusForId.get('in_reply_to_id') === null || statusForId.get('in_reply_to_account_id') === me); | ||||
|     if (columnSettings.getIn(['shows', 'reply']) === false && statusForId.get('in_reply_to_id') !== null && statusForId.get('in_reply_to_account_id') !== me) { | ||||
|       return false; | ||||
|     } | ||||
| 
 | ||||
|     return showStatus; | ||||
|     if (columnSettings.getIn(['shows', 'quote']) === false && statusForId.get('quote') !== null) { | ||||
|       return false; | ||||
|     } | ||||
| 
 | ||||
|     return true; | ||||
|   }); | ||||
| }); | ||||
| 
 | ||||
|  |  | |||
|  | @ -430,6 +430,7 @@ | |||
|   "hints.profiles.see_more_posts": "See more posts on {domain}", | ||||
|   "hints.threads.replies_may_be_missing": "Replies from other servers may be missing.", | ||||
|   "hints.threads.see_more": "See more replies on {domain}", | ||||
|   "home.column_settings.show_quotes": "Show quotes", | ||||
|   "home.column_settings.show_reblogs": "Show boosts", | ||||
|   "home.column_settings.show_replies": "Show replies", | ||||
|   "home.hide_announcements": "Hide announcements", | ||||
|  |  | |||
|  | @ -20,6 +20,7 @@ const initialState = ImmutableMap({ | |||
| 
 | ||||
|   home: ImmutableMap({ | ||||
|     shows: ImmutableMap({ | ||||
|       quote: true, | ||||
|       reblog: true, | ||||
|       reply: true, | ||||
|     }), | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue