Compare commits

...

8 Commits

Author SHA1 Message Date
Claire f407505f75
Merge pull request #2667 from ClearlyClaire/glitch-soc/merge-upstream
Merge upstream changes up to 653ce43abe
2024-03-07 19:04:33 +01:00
Mashiro 1fc6edfa84 [Glitch] Fix unhandled nullable attachments limitation counter
Port b8bd94ca8e to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2024-03-07 13:01:21 +01:00
Claire 442a5cb66c Merge commit '653ce43abe0a928d944a15c433d2c8324f9b5e2a' into glitch-soc/merge-upstream 2024-03-07 12:59:51 +01:00
Claire 3f239facff
Update flavor screenshots (#2664) 2024-03-07 12:59:00 +01:00
Renaud Chaput 653ce43abe
Update `json-jwt` gem to fix CVE-2023-51774 (#29520) 2024-03-07 11:11:14 +00:00
gunchleoc c01f4cebed
Add Mohawk to posting languages (#27115) 2024-03-07 11:04:31 +00:00
gunchleoc 995e15c24a
Add Jawi Malay to posting languages (#29098) 2024-03-07 11:03:41 +00:00
Mashiro b8bd94ca8e
Fix unhandled nullable attachments limitation counter (#29183) 2024-03-06 12:53:54 +00:00
10 changed files with 35 additions and 13 deletions

View File

@ -357,7 +357,7 @@ GEM
jmespath (1.6.2)
json (2.7.1)
json-canonicalization (1.0.0)
json-jwt (1.15.3)
json-jwt (1.15.3.1)
activesupport (>= 4.2)
aes_key_wrap
bindata

View File

@ -109,6 +109,7 @@ module LanguagesHelper
mn: ['Mongolian', 'Монгол хэл'].freeze,
mr: ['Marathi', 'मराठी'].freeze,
ms: ['Malay', 'Bahasa Melayu'].freeze,
'ms-Arab': ['Jawi Malay', 'بهاس ملايو'].freeze,
mt: ['Maltese', 'Malti'].freeze,
my: ['Burmese', 'ဗမာစာ'].freeze,
na: ['Nauru', 'Ekakairũ Naoero'].freeze,
@ -196,6 +197,7 @@ module LanguagesHelper
kab: ['Kabyle', 'Taqbaylit'].freeze,
ldn: ['Láadan', 'Láadan'].freeze,
lfn: ['Lingua Franca Nova', 'lingua franca nova'].freeze,
moh: ['Mohawk', 'Kanienʼkéha'].freeze,
pdc: ['Pennsylvania Dutch', 'Pennsilfaani-Deitsch'].freeze,
sco: ['Scots', 'Scots'].freeze,
sma: ['Southern Sami', 'Åarjelsaemien Gïele'].freeze,

View File

@ -4,14 +4,24 @@ import { uploadCompose } from '../../../actions/compose';
import { openModal } from '../../../actions/modal';
import UploadButton from '../components/upload_button';
const mapStateToProps = state => ({
disabled: state.getIn(['compose', 'poll']) !== null || state.getIn(['compose', 'is_uploading']) || (state.getIn(['compose', 'media_attachments']).size + state.getIn(['compose', 'pending_media_attachments']) > 3 || state.getIn(['compose', 'media_attachments']).some(m => ['video', 'audio'].includes(m.get('type')))),
resetFileKey: state.getIn(['compose', 'resetFileKey']),
});
const mapStateToProps = state => {
const isPoll = state.getIn(['compose', 'poll']) !== null;
const isUploading = state.getIn(['compose', 'is_uploading']);
const readyAttachmentsSize = state.getIn(['compose', 'media_attachments']).size ?? 0;
const pendingAttachmentsSize = state.getIn(['compose', 'pending_media_attachments']).size ?? 0;
const attachmentsSize = readyAttachmentsSize + pendingAttachmentsSize;
const isOverLimit = attachmentsSize > 3;
const hasVideoOrAudio = state.getIn(['compose', 'media_attachments']).some(m => ['video', 'audio'].includes(m.get('type')));
return {
disabled: isPoll || isUploading || isOverLimit || hasVideoOrAudio,
resetFileKey: state.getIn(['compose', 'resetFileKey']),
};
};
const mapDispatchToProps = dispatch => ({
onSelectFile (files) {
onSelectFile(files) {
dispatch(uploadCompose(files));
},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

View File

@ -33,7 +33,7 @@ inherit_locales: vanilla
# (OPTIONAL) A file to use as the preview screenshot for the flavour,
# or an array thereof. These are the full path from `app/javascript/`.
screenshot: flavours/glitch/images/glitch-preview.jpg
screenshot: flavours/glitch/images/glitch-preview.png
# (OPTIONAL) The directory which contains the pack files.
# Defaults to the theme directory (`app/javascript/themes/[theme]`),

View File

@ -28,7 +28,7 @@ locales: ../../mastodon/locales
# (OPTIONAL) A file to use as the preview screenshot for the flavour,
# or an array thereof. These are the full path from `app/javascript/`.
screenshot: images/screenshot.jpg
screenshot: images/screenshot.png
# (OPTIONAL) The directory which contains the pack files.
# Defaults to this directory (`app/javascript/flavour/[flavour]`),

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 155 KiB

View File

@ -3,14 +3,24 @@ import { connect } from 'react-redux';
import { uploadCompose } from '../../../actions/compose';
import UploadButton from '../components/upload_button';
const mapStateToProps = state => ({
disabled: state.getIn(['compose', 'poll']) !== null || state.getIn(['compose', 'is_uploading']) || (state.getIn(['compose', 'media_attachments']).size + state.getIn(['compose', 'pending_media_attachments']) > 3 || state.getIn(['compose', 'media_attachments']).some(m => ['video', 'audio'].includes(m.get('type')))),
resetFileKey: state.getIn(['compose', 'resetFileKey']),
});
const mapStateToProps = state => {
const isPoll = state.getIn(['compose', 'poll']) !== null;
const isUploading = state.getIn(['compose', 'is_uploading']);
const readyAttachmentsSize = state.getIn(['compose', 'media_attachments']).size ?? 0;
const pendingAttachmentsSize = state.getIn(['compose', 'pending_media_attachments']).size ?? 0;
const attachmentsSize = readyAttachmentsSize + pendingAttachmentsSize;
const isOverLimit = attachmentsSize > 3;
const hasVideoOrAudio = state.getIn(['compose', 'media_attachments']).some(m => ['video', 'audio'].includes(m.get('type')));
return {
disabled: isPoll || isUploading || isOverLimit || hasVideoOrAudio,
resetFileKey: state.getIn(['compose', 'resetFileKey']),
};
};
const mapDispatchToProps = dispatch => ({
onSelectFile (files) {
onSelectFile(files) {
dispatch(uploadCompose(files));
},