Merge commit 'a863e68d174b176dc350d8e3472c010cd37b7807' into glitch-soc/merge-upstream
Conflicts: - `app/models/trends/statuses.rb`: Conflict because of glitch-soc's setting to allow CWs in trends. Kept glitch-soc's setting but followed upstream's refactor. - `docker-compose.yml`: Conflict because of upstream VS glitch-soc repos. Updated version number as upstream did, but kept glitch-soc repos.
This commit is contained in:
commit
72affd6b45
94 files changed
+477
-458
No files matched your search
@@ -5,8 +5,8 @@ import type { List as ImmutableList } from 'immutable';
|
||||
import { isList } from 'immutable';
|
||||
|
||||
import type { ApiCustomEmojiJSON } from '@/mastodon/api_types/custom_emoji';
|
||||
import { isFeatureEnabled } from '@/mastodon/initial_state';
|
||||
import type { CustomEmoji } from '@/mastodon/models/custom_emoji';
|
||||
import { isModernEmojiEnabled } from '@/mastodon/utils/environment';
|
||||
|
||||
import { useEmojiAppState } from './hooks';
|
||||
import { emojifyElement } from './render';
|
||||
@@ -25,7 +25,7 @@ export const EmojiHTML: React.FC<EmojiHTMLProps> = ({
|
||||
extraEmojis,
|
||||
...props
|
||||
}) => {
|
||||
if (isFeatureEnabled('modern_emojis')) {
|
||||
if (isModernEmojiEnabled()) {
|
||||
return (
|
||||
<ModernEmojiHTML
|
||||
htmlString={htmlString}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import initialState from '@/mastodon/initial_state';
|
||||
import { loadWorker } from '@/mastodon/utils/workers';
|
||||
|
||||
import { toSupportedLocale } from './locale';
|
||||
|
||||
@@ -9,9 +10,8 @@ let worker: Worker | null = null;
|
||||
export async function initializeEmoji() {
|
||||
if (!worker && 'Worker' in window) {
|
||||
try {
|
||||
worker = new Worker(new URL('./worker', import.meta.url), {
|
||||
worker = loadWorker(new URL('./worker', import.meta.url), {
|
||||
type: 'module',
|
||||
credentials: 'omit',
|
||||
});
|
||||
} catch (err) {
|
||||
console.warn('Error creating web worker:', err);
|
||||
|
||||
@@ -36,15 +36,16 @@ async function fetchAndCheckEtag<ResultType extends object[]>(
|
||||
): Promise<ResultType | null> {
|
||||
const locale = toSupportedLocaleOrCustom(localeOrCustom);
|
||||
|
||||
let uri: string;
|
||||
// Use location.origin as this script may be loaded from a CDN domain.
|
||||
const url = new URL(location.origin);
|
||||
if (locale === 'custom') {
|
||||
uri = '/api/v1/custom_emojis';
|
||||
url.pathname = '/api/v1/custom_emojis';
|
||||
} else {
|
||||
uri = `/packs${isDevelopment() ? '-dev' : ''}/emoji/${locale}.json`;
|
||||
url.pathname = `/packs${isDevelopment() ? '-dev' : ''}/emoji/${locale}.json`;
|
||||
}
|
||||
|
||||
const oldEtag = await loadLatestEtag(locale);
|
||||
const response = await fetch(uri, {
|
||||
const response = await fetch(url, {
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'If-None-Match': oldEtag ?? '', // Send the old ETag to check for modifications
|
||||
|
||||
@@ -21,6 +21,7 @@ import { openModal } from 'mastodon/actions/modal';
|
||||
import { IconButton } from 'mastodon/components/icon_button';
|
||||
import { useIdentity } from 'mastodon/identity_context';
|
||||
import { me } from 'mastodon/initial_state';
|
||||
import type { Account } from 'mastodon/models/account';
|
||||
import type { Status } from 'mastodon/models/status';
|
||||
import { makeGetStatus } from 'mastodon/selectors';
|
||||
import type { RootState } from 'mastodon/store';
|
||||
@@ -66,10 +67,7 @@ export const Footer: React.FC<{
|
||||
const dispatch = useAppDispatch();
|
||||
const getStatus = useMemo(() => makeGetStatus(), []) as GetStatusSelector;
|
||||
const status = useAppSelector((state) => getStatus(state, { id: statusId }));
|
||||
const accountId = status?.get('account') as string | undefined;
|
||||
const account = useAppSelector((state) =>
|
||||
accountId ? state.accounts.get(accountId) : undefined,
|
||||
);
|
||||
const account = status?.get('account') as Account | undefined;
|
||||
const askReplyConfirmation = useAppSelector(
|
||||
(state) => (state.compose.get('text') as string).trim().length !== 0,
|
||||
);
|
||||
|
||||
@@ -306,10 +306,8 @@ export const ZoomableImage: React.FC<ZoomableImageProps> = ({
|
||||
|
||||
<animated.img
|
||||
style={{ transform }}
|
||||
role='presentation'
|
||||
ref={imageRef}
|
||||
alt={alt}
|
||||
title={alt}
|
||||
lang={lang}
|
||||
src={src}
|
||||
width={width}
|
||||
|
||||
Reference in new issue
Block a user