Might as well add more supports

pull/501/head
Lim Chee Aun 2024-04-15 19:58:59 +08:00
rodzic 701b9e99b3
commit e2f39596f0
2 zmienionych plików z 31 dodań i 24 usunięć

Wyświetl plik

@ -23,6 +23,7 @@ import showToast from '../utils/show-toast';
import states, { hideAllModals } from '../utils/states'; import states, { hideAllModals } from '../utils/states';
import store from '../utils/store'; import store from '../utils/store';
import { getCurrentAccountID, updateAccount } from '../utils/store-utils'; import { getCurrentAccountID, updateAccount } from '../utils/store-utils';
import supports from '../utils/supports';
import AccountBlock from './account-block'; import AccountBlock from './account-block';
import Avatar from './avatar'; import Avatar from './avatar';
@ -1091,6 +1092,7 @@ function RelatedActions({
<Icon icon="translate" /> <Icon icon="translate" />
<span>Translate bio</span> <span>Translate bio</span>
</MenuItem> </MenuItem>
{supports('@mastodon/profile-private-note') && (
<MenuItem <MenuItem
onClick={() => { onClick={() => {
setShowPrivateNoteModal(true); setShowPrivateNoteModal(true);
@ -1101,6 +1103,7 @@ function RelatedActions({
{privateNote ? 'Edit private note' : 'Add private note'} {privateNote ? 'Edit private note' : 'Add private note'}
</span> </span>
</MenuItem> </MenuItem>
)}
{following && !!relationship && ( {following && !!relationship && (
<> <>
<MenuItem <MenuItem
@ -1449,7 +1452,10 @@ function RelatedActions({
</MenuItem> </MenuItem>
</> </>
)} )}
{currentAuthenticated && isSelf && standalone && ( {currentAuthenticated &&
isSelf &&
standalone &&
supports('@mastodon/profile-edit') && (
<> <>
<MenuDivider /> <MenuDivider />
<MenuItem <MenuItem

Wyświetl plik

@ -5,7 +5,6 @@ import features from '../data/features.json';
import { getCurrentInstance } from './store-utils'; import { getCurrentInstance } from './store-utils';
// Non-semver(?) UA string detection // Non-semver(?) UA string detection
// Can't put this inside features.json due to regex
const containPixelfed = /pixelfed/i; const containPixelfed = /pixelfed/i;
const notContainPixelfed = /^(?!.*pixelfed).*$/i; const notContainPixelfed = /^(?!.*pixelfed).*$/i;
const platformFeatures = { const platformFeatures = {
@ -16,6 +15,8 @@ const platformFeatures = {
'@mastodon/trending-links': notContainPixelfed, '@mastodon/trending-links': notContainPixelfed,
'@mastodon/post-bookmark': notContainPixelfed, '@mastodon/post-bookmark': notContainPixelfed,
'@mastodon/post-edit': notContainPixelfed, '@mastodon/post-edit': notContainPixelfed,
'@mastodon/profile-edit': notContainPixelfed,
'@mastodon/profile-private-note': notContainPixelfed,
'@pixelfed/trending': containPixelfed, '@pixelfed/trending': containPixelfed,
}; };
const supportsCache = {}; const supportsCache = {};