Skip to content

Commit fde3e42

Browse files
committed
Add pleroma compatibility
1 parent 147b518 commit fde3e42

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

src/components/compose.jsx

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
import './compose.css';
22
import '@github/text-expander-element';
33

4-
import { msg, plural, t, Trans } from '@lingui/macro';
4+
import { plural, t, Trans } from '@lingui/macro';
55
import { useLingui } from '@lingui/react';
66
import { MenuItem } from '@szhsin/react-menu';
77
import { deepEqual } from 'fast-equals';
88
import Fuse from 'fuse.js';
99
import { forwardRef, memo } from 'preact/compat';
10-
import {
11-
useCallback,
12-
useEffect,
13-
useMemo,
14-
useRef,
15-
useState,
16-
} from 'preact/hooks';
10+
import { useCallback, useEffect, useMemo, useRef, useState } from 'preact/hooks';
1711
import { useHotkeys } from 'react-hotkeys-hook';
1812
import stringLength from 'string-length';
1913
// import { detectAll } from 'tinyld/light';
@@ -43,12 +37,7 @@ import shortenNumber from '../utils/shorten-number';
4337
import showToast from '../utils/show-toast';
4438
import states, { saveStatus } from '../utils/states';
4539
import store from '../utils/store';
46-
import {
47-
getCurrentAccount,
48-
getCurrentAccountNS,
49-
getCurrentInstance,
50-
getCurrentInstanceConfiguration,
51-
} from '../utils/store-utils';
40+
import { getCurrentAccount, getCurrentAccountNS, getCurrentInstanceConfiguration } from '../utils/store-utils';
5241
import supports from '../utils/supports';
5342
import useCloseWatcher from '../utils/useCloseWatcher';
5443
import useInterval from '../utils/useInterval';
@@ -61,6 +50,7 @@ import Loader from './loader';
6150
import Modal from './modal';
6251
import Status from './status';
6352

53+
6454
const {
6555
PHANPY_IMG_ALT_API_URL: IMG_ALT_API_URL,
6656
PHANPY_GIPHY_API_KEY: GIPHY_API_KEY,
@@ -1155,7 +1145,9 @@ function Compose({
11551145
/>
11561146
<Icon icon={`eye-${sensitive ? 'close' : 'open'}`} />
11571147
</label>{' '}
1158-
{supports('@akkoma/post-content-type') && (
1148+
{(
1149+
supports('@akkoma/post-content-type') | supports('@pleroma/post-content-type')
1150+
) && (
11591151
<>
11601152
<label
11611153
class={`toolbar-button ${
@@ -1189,9 +1181,11 @@ function Compose({
11891181
<option value="text/bbcode">
11901182
<Trans>BBCode</Trans>
11911183
</option>
1192-
<option value="text/x.misskeymarkdown">
1193-
<Trans>MFM</Trans>
1194-
</option>
1184+
{supports('@akkoma/post-content-type') && (
1185+
<option value="text/x.misskeymarkdown">
1186+
<Trans>MFM</Trans>
1187+
</option>
1188+
)}
11951189
</select>
11961190
</label>{' '}
11971191
</>

src/utils/supports.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ const platformFeatures = {
2424
'@pixelfed/global-feed': containPixelfed,
2525
'@pleroma/local-visibility-post': containPleroma,
2626
'@akkoma/local-visibility-post': containAkkoma,
27+
'@pleroma/post-content-type': containPleroma,
2728
'@akkoma/post-content-type': containAkkoma,
2829
};
2930
const supportsCache = {};

0 commit comments

Comments
 (0)