diff --git a/src/components/account-info.jsx b/src/components/account-info.jsx index 35ea89ea..49cb4274 100644 --- a/src/components/account-info.jsx +++ b/src/components/account-info.jsx @@ -23,6 +23,7 @@ import showToast from '../utils/show-toast'; import states, { hideAllModals } from '../utils/states'; import store from '../utils/store'; import { getCurrentAccountID, updateAccount } from '../utils/store-utils'; +import supports from '../utils/supports'; import AccountBlock from './account-block'; import Avatar from './avatar'; @@ -1091,16 +1092,18 @@ function RelatedActions({ Translate bio - { - setShowPrivateNoteModal(true); - }} - > - - - {privateNote ? 'Edit private note' : 'Add private note'} - - + {supports('@mastodon/profile-private-note') && ( + { + setShowPrivateNoteModal(true); + }} + > + + + {privateNote ? 'Edit private note' : 'Add private note'} + + + )} {following && !!relationship && ( <> )} - {currentAuthenticated && isSelf && standalone && ( - <> - - { - setShowEditProfile(true); - }} - > - - Edit profile - - - )} + {currentAuthenticated && + isSelf && + standalone && + supports('@mastodon/profile-edit') && ( + <> + + { + setShowEditProfile(true); + }} + > + + Edit profile + + + )} {import.meta.env.DEV && currentAuthenticated && isSelf && ( <> diff --git a/src/utils/supports.js b/src/utils/supports.js index 4733cd97..6b94126e 100644 --- a/src/utils/supports.js +++ b/src/utils/supports.js @@ -5,7 +5,6 @@ import features from '../data/features.json'; import { getCurrentInstance } from './store-utils'; // Non-semver(?) UA string detection -// Can't put this inside features.json due to regex const containPixelfed = /pixelfed/i; const notContainPixelfed = /^(?!.*pixelfed).*$/i; const platformFeatures = { @@ -16,6 +15,8 @@ const platformFeatures = { '@mastodon/trending-links': notContainPixelfed, '@mastodon/post-bookmark': notContainPixelfed, '@mastodon/post-edit': notContainPixelfed, + '@mastodon/profile-edit': notContainPixelfed, + '@mastodon/profile-private-note': notContainPixelfed, '@pixelfed/trending': containPixelfed, }; const supportsCache = {};