-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hide trending where not supported and update compatibility table #768
Conversation
src/utils/supports.js
Outdated
@@ -9,12 +9,13 @@ const containPixelfed = /pixelfed/i; | |||
const notContainPixelfed = /^(?!.*pixelfed).*$/i; | |||
const containPleroma = /pleroma/i; | |||
const containAkkoma = /akkoma/i; | |||
const notContainPixelfedAkkomaPleroma = /^(?!.*pixelfed|.*akkoma|.*pleroma).*$/i; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😂 I think, as this is becoming more complex, (simple, negated?) regex check is no longer feasible. Best way is for the check to accept a function. Maybe like:
'@mastodon/trending-hashtags': (version) => !containPixelfed.test(version) && !containPleroma.test(version) && !containAkkoma.test(version)
I initially added notContainPixelfed
because I was lazy and didn't expect to add more conditions 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that sounds like the wiser decision lol
return (supportsCache[key] = platformFeatures[feature].test(version)); | ||
|
||
const platformFeature = platformFeatures[feature]; | ||
if (platformFeature instanceof Function) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer typeof platformFeature === 'function'
if (platformFeature instanceof Function) { | ||
return (supportsCache[key] = platformFeature(version)); | ||
} | ||
else if(platformFeature !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feels like prettier didn't run here 🙈 Should be } else if () {
GoToSocial also doesn't support trending links or trending hashtags so it might be added to this PR. Alternatively, is there any server software other than Mastodon and its forks (Glitch, Hometown) that does support Mastodon's trending links and trending hashtags API? Pixelfed, Pleroma, Akkoma and GTS all don't, so that seems about it. I wonder if what's really wanted here is an explicit notion of "server is Mastodon." If so, that could be done by checking the |
This reverts commit 324384a.
This should allow access to the "Go to another server" menu option for now.
Just realized that the "Go to another instance" button is available on the Trending page, so hiding it completely might not be a good idea... Let's go back to the planning stage! |
pleroma and akkoma don't support Trending, perhaps by development philosophy.
This pull request allows hiding the option from the menu for accounts on such instances, and additionally does the same with the Filter option.