kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Support Ditto client tag
rodzic
0cb6658306
commit
e8fe0826c2
|
@ -1,4 +1,5 @@
|
|||
import { Status as StatusEntity } from 'soapbox/schemas/index.ts';
|
||||
import { settingsSchema } from 'soapbox/schemas/soapbox/settings.ts';
|
||||
import { isLoggedIn } from 'soapbox/utils/auth.ts';
|
||||
import { getFeatures } from 'soapbox/utils/features.ts';
|
||||
import { shouldHaveCard } from 'soapbox/utils/status.ts';
|
||||
|
@ -9,6 +10,7 @@ import { setComposeToStatus } from './compose-status.ts';
|
|||
import { fetchGroupRelationships } from './groups.ts';
|
||||
import { importFetchedStatus, importFetchedStatuses } from './importer/index.ts';
|
||||
import { openModal } from './modals.ts';
|
||||
import { getSettings } from './settings.ts';
|
||||
import { deleteFromTimelines } from './timelines.ts';
|
||||
|
||||
import type { AppDispatch, RootState } from 'soapbox/store.ts';
|
||||
|
@ -58,6 +60,12 @@ const statusExists = (getState: () => RootState, statusId: string) => {
|
|||
|
||||
const createStatus = (params: Record<string, any>, idempotencyKey: string, statusId: string | null) => {
|
||||
return (dispatch: AppDispatch, getState: () => RootState) => {
|
||||
const settings = settingsSchema.parse(getSettings(getState()).toJS());
|
||||
|
||||
if (settings.discloseClient) {
|
||||
params.disclose_client = true;
|
||||
}
|
||||
|
||||
dispatch({ type: STATUS_CREATE_REQUEST, params, idempotencyKey, editing: !!statusId });
|
||||
|
||||
const method = statusId === null ? 'POST' : 'PUT';
|
||||
|
|
|
@ -166,6 +166,12 @@ const Preferences = () => {
|
|||
</ListItem>
|
||||
)}
|
||||
|
||||
{features.nostr && (
|
||||
<ListItem label={<FormattedMessage id='preferences.fields.disclose_client' defaultMessage='Disclose client' />}>
|
||||
<SettingToggle settings={settings} settingPath={['discloseClient']} onChange={onToggleChange} />
|
||||
</ListItem>
|
||||
)}
|
||||
|
||||
{features.richText && (
|
||||
<ListItem label={<FormattedMessage id='preferences.fields.content_type_label' defaultMessage='Default post format' />}>
|
||||
<SelectDropdown
|
||||
|
|
|
@ -181,6 +181,24 @@ const DetailedStatus: React.FC<IDetailedStatus> = ({
|
|||
{statusTypeIcon}
|
||||
|
||||
<span>
|
||||
{actualStatus.application && (
|
||||
<>
|
||||
{actualStatus.application.get('website') ? (
|
||||
<a href={actualStatus.application.get('website')} target='_blank' rel='noopener' className='hover:underline'>
|
||||
<Text tag='span' theme='muted' size='sm'>
|
||||
{actualStatus.application.get('name')}
|
||||
</Text>
|
||||
</a>
|
||||
) : (
|
||||
<Text tag='span' theme='muted' size='sm'>
|
||||
{actualStatus.application.get('name')}
|
||||
</Text>
|
||||
)}
|
||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||
<Text tag='span' theme='muted' size='sm'>{' · '}</Text>
|
||||
</>
|
||||
)}
|
||||
|
||||
<a href={actualStatus.url} target='_blank' rel='noopener' className='hover:underline'>
|
||||
<Text tag='span' theme='muted' size='sm'>
|
||||
<FormattedDate value={new Date(actualStatus.created_at)} hour12 year='numeric' month='short' day='2-digit' hour='numeric' minute='2-digit' />
|
||||
|
@ -189,7 +207,8 @@ const DetailedStatus: React.FC<IDetailedStatus> = ({
|
|||
|
||||
{actualStatus.edited_at && (
|
||||
<>
|
||||
{' · '}
|
||||
{/* eslint-disable-next-line formatjs/no-literal-string-in-jsx */}
|
||||
<Text tag='span' theme='muted' size='sm'>{' · '}</Text>
|
||||
<div
|
||||
className='inline hover:underline'
|
||||
onClick={handleOpenCompareHistoryModal}
|
||||
|
|
|
@ -9,6 +9,7 @@ const skinToneSchema = z.union([
|
|||
]);
|
||||
|
||||
const settingsSchema = z.object({
|
||||
discloseClient: z.boolean().catch(true),
|
||||
onboarded: z.boolean().catch(false),
|
||||
skinTone: skinToneSchema.catch(1),
|
||||
reduceMotion: z.boolean().catch(false),
|
||||
|
|
Ładowanie…
Reference in New Issue