Make public favorites optional (Akkoma/Sharkey.NET?)

This commit is contained in:
Henry Jameson 2025-06-16 15:31:21 +03:00
commit ac8519c166
3 changed files with 6 additions and 1 deletions

View file

@ -81,7 +81,7 @@ const UserProfile = {
return this.isUs || !this.user.hide_followers
},
favoritesTabVisible () {
return this.isUs || !this.user.hide_favorites
return this.isUs || (this.$store.state.instance.pleromaPublicFavouritesAvailable && !this.user.hide_favorites)
},
formattedBirthday () {
const browserLocale = localeService.internalToBrowserLocale(this.$i18n.locale)

View file

@ -156,6 +156,7 @@ const defaultState = {
pleromaChatMessagesAvailable: false,
pleromaCustomEmojiReactionsAvailable: false,
pleromaBookmarkFoldersAvailable: false,
pleromaPublicFavouritesAvailable: true,
gopherAvailable: false,
mediaProxyAvailable: false,
suggestionsEnabled: false,

View file

@ -63,6 +63,10 @@ const fetchAndUpdate = ({
return apiService.fetchTimeline(args)
.then(response => {
if (response.errors) {
if (timeline === 'favorites') {
rootState.instance.pleromaPublicFavouritesAvailable = false
return
}
throw new Error(`${response.status} ${response.statusText}`)
}