From 6d0b964e2bab79ee0cb448c7772883f57b2818ec Mon Sep 17 00:00:00 2001 From: "Sqx. Flann" Date: Mon, 23 Jun 2025 10:51:25 +0200 Subject: [PATCH] [feature] Query media description limit (#62) fixes #61 Reviewed-on: https://codeberg.org/superseriousbusiness/masto-fe-standalone/pulls/62 Co-authored-by: Sqx. Flann Co-committed-by: Sqx. Flann --- app/javascript/flavours/glitch/actions/server.js | 11 +++++++++-- .../features/ui/components/focal_point_modal.jsx | 5 +++-- app/javascript/flavours/glitch/initial_state.js | 2 ++ app/javascript/mastodon/actions/server.js | 11 +++++++++-- .../features/ui/components/focal_point_modal.jsx | 5 +++-- app/javascript/mastodon/initial_state.js | 2 ++ public/verify-state.js | 11 ++++++++++- 7 files changed, 38 insertions(+), 9 deletions(-) diff --git a/app/javascript/flavours/glitch/actions/server.js b/app/javascript/flavours/glitch/actions/server.js index 6e842d277..5889bb65a 100644 --- a/app/javascript/flavours/glitch/actions/server.js +++ b/app/javascript/flavours/glitch/actions/server.js @@ -21,11 +21,18 @@ export const fetchServer = () => (dispatch, getState) => { dispatch(fetchServerRequest()); - api(getState) - .get('/api/v2/instance').then(({ data }) => { + try { + api(getState) + .get('/api/v2/instance').then({ data }) if (data.contact.account) dispatch(importFetchedAccount(data.contact.account)); dispatch(fetchServerSuccess(data)); + } catch (e) { + api(getState) + .get('/api/v1/instance').then(({ data }) => { + if (data.contact.account) dispatch(importFetchedAccount(data.contact.account)); + dispatch(fetchServerSuccess(data)); }).catch(err => dispatch(fetchServerFail(err))); + } }; const fetchServerRequest = () => ({ diff --git a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx index eeef42277..f0a5f32e0 100644 --- a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx +++ b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx @@ -26,6 +26,7 @@ import { Tesseract as fetchTesseract } from 'flavours/glitch/features/ui/util/as import Video, { getPointerPosition } from 'flavours/glitch/features/video'; import { me } from 'flavours/glitch/initial_state'; import { assetHost } from 'flavours/glitch/utils/config'; +import { maxMediaDescChars } from 'flavours/glitch/initial_state'; import { changeUploadCompose, uploadThumbnail, onChangeMediaDescription, onChangeMediaFocus } from '../../../actions/compose'; @@ -367,10 +368,10 @@ class FocalPointModal extends ImmutablePureComponent {
- +
- - +