add toggle for deduping boosts

This commit is contained in:
notfire 2025-03-31 09:20:31 -04:00
parent 7a26107808
commit d575980d1e
Signed by: notfire
GPG key ID: 3AFDACAAB4E56B16
6 changed files with 15 additions and 3 deletions

View file

@ -15,6 +15,7 @@
- custom ones for certain users - custom ones for certain users
- volume controls for all sounds individually - volume controls for all sounds individually
- rename "repeats" to "boosts" - rename "repeats" to "boosts"
- add toggle for deduping boosts (this was done by default upstream)
- raise limits: - raise limits:
- polls can now have up to 20 options instead of 4 - polls can now have up to 20 options instead of 4
- polls can now last anywhere from 1 second to 1000 years - polls can now last anywhere from 1 second to 1000 years

View file

@ -285,6 +285,14 @@
{{ $t('settings.search_pagination_limit') }} {{ $t('settings.search_pagination_limit') }}
</IntegerSetting> </IntegerSetting>
</li> </li>
<li>
<BooleanSetting
path="dedupeBoosts"
expert="1"
>
{{ $t('settings.dedupe_boosts') }}
</BooleanSetting>
</li>
<li> <li>
<h3>{{ $t('settings.columns') }}</h3> <h3>{{ $t('settings.columns') }}</h3>
</li> </li>

View file

@ -541,6 +541,7 @@
"current_mascot": "Your current mascot", "current_mascot": "Your current mascot",
"current_password": "Current password", "current_password": "Current password",
"data_import_export_tab": "Data import / export", "data_import_export_tab": "Data import / export",
"dedupe_boosts": "Deduplicate boosts on the timeline (requires refresh/re-fetch)",
"default_vis": "Default visibility scope", "default_vis": "Default visibility scope",
"delete_account": "Delete account", "delete_account": "Delete account",
"delete_account_description": "Permanently delete your data and deactivate your account.", "delete_account_description": "Permanently delete your data and deactivate your account.",

View file

@ -127,6 +127,7 @@ export const defaultState = {
reactionsFilterItems: '', reactionsFilterItems: '',
recurseSearch: false, recurseSearch: false,
recurseSearchLimit: 100, recurseSearchLimit: 100,
dedupeBoosts: true,
renderMisskeyMarkdown: undefined, renderMisskeyMarkdown: undefined,
renderMfmOnHover: undefined, // instance default renderMfmOnHover: undefined, // instance default
conversationDisplay: undefined, // instance default conversationDisplay: undefined, // instance default

View file

@ -83,6 +83,7 @@ const defaultState = {
reactionsFilterItems: '', reactionsFilterItems: '',
recurseSearch: false, recurseSearch: false,
recurseSearchLimit: 100, recurseSearchLimit: 100,
dedupeBoosts: true,
renderMisskeyMarkdown: true, renderMisskeyMarkdown: true,
renderMfmOnHover: false, renderMfmOnHover: false,
conversationDisplay: 'linear', conversationDisplay: 'linear',

View file

@ -155,7 +155,7 @@ const removeStatusFromGlobalStorage = (state, status) => {
} }
} }
const addNewStatuses = (state, { statuses, showImmediately = false, timeline, user = {}, noIdUpdate = false, userId, pagination = {} }) => { const addNewStatuses = (state, { statuses, showImmediately = false, timeline, user = {}, noIdUpdate = false, userId, pagination = {}, rootState }) => {
// Sanity check // Sanity check
if (!isArray(statuses)) { if (!isArray(statuses)) {
return false return false
@ -261,7 +261,7 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
let retweet let retweet
// If the retweeted status is already there, don't add the retweet // If the retweeted status is already there, don't add the retweet
// to the timeline. // to the timeline.
if (timeline && find(timelineObject.statuses, (s) => { if (rootState.config.dedupeBoosts && timeline && find(timelineObject.statuses, (s) => {
if (s.retweeted_status) { if (s.retweeted_status) {
return s.id === retweetedStatus.id || s.retweeted_status.id === retweetedStatus.id return s.id === retweetedStatus.id || s.retweeted_status.id === retweetedStatus.id
} else { } else {
@ -590,7 +590,7 @@ const statuses = {
state: defaultState(), state: defaultState(),
actions: { actions: {
addNewStatuses ({ rootState, commit }, { statuses, showImmediately = false, timeline = false, noIdUpdate = false, userId, pagination }) { addNewStatuses ({ rootState, commit }, { statuses, showImmediately = false, timeline = false, noIdUpdate = false, userId, pagination }) {
commit('addNewStatuses', { statuses, showImmediately, timeline, noIdUpdate, user: rootState.users.currentUser, userId, pagination }) commit('addNewStatuses', { statuses, showImmediately, timeline, noIdUpdate, user: rootState.users.currentUser, userId, pagination, rootState })
}, },
addNewNotifications (store, { notifications, older }) { addNewNotifications (store, { notifications, older }) {
const { commit, dispatch, rootGetters } = store const { commit, dispatch, rootGetters } = store