From 6dd51448a6ba318d3007169c443f6613a0944eea Mon Sep 17 00:00:00 2001 From: Claire Date: Tue, 15 Jun 2021 22:11:07 +0200 Subject: [Glitch] Fix OCR failure when erroneous lang data is in cache Port 8428faa0859d86c97950084658498a2c25e26f15 to glitch-soc Signed-off-by: Claire --- .../glitch/features/ui/components/focal_point_modal.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js index 893e76585..b7ec63333 100644 --- a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js @@ -219,6 +219,10 @@ class FocalPointModal extends ImmutablePureComponent { } handleTextDetection = () => { + this._detectText(); + } + + _detectText = (refreshCache = false) => { const { media } = this.props; this.setState({ detecting: true }); @@ -235,6 +239,7 @@ class FocalPointModal extends ImmutablePureComponent { this.setState({ ocrStatus: 'preparing', progress }); } }, + cacheMethod: refreshCache ? 'refresh' : 'write', }); let media_url = media.get('url'); @@ -247,14 +252,20 @@ class FocalPointModal extends ImmutablePureComponent { } } - (async () => { + return (async () => { await worker.load(); await worker.loadLanguage('eng'); await worker.initialize('eng'); const { data: { text } } = await worker.recognize(media_url); this.setState({ description: removeExtraLineBreaks(text), dirty: true, detecting: false }); await worker.terminate(); - })(); + })().catch((e) => { + if (refreshCache) { + throw e; + } else { + this._detectText(true); + } + }); }).catch((e) => { console.error(e); this.setState({ detecting: false }); -- cgit From d10d1e5eac5fd48f976b9cb745c033f36c606dbb Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 21 Jun 2021 17:07:30 +0200 Subject: [Glitch] Add authentication history Port SCSS changes from d174d12c831989bf1d5d3ca54d4f26d28c2c8925 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/styles/forms.scss | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/styles/forms.scss b/app/javascript/flavours/glitch/styles/forms.scss index b93acd6cd..3433abcdd 100644 --- a/app/javascript/flavours/glitch/styles/forms.scss +++ b/app/javascript/flavours/glitch/styles/forms.scss @@ -11,6 +11,24 @@ code { margin: 0 auto; } +.indicator-icon { + display: flex; + align-items: center; + justify-content: center; + width: 40px; + height: 40px; + border-radius: 50%; + color: $primary-text-color; + + &.success { + background: $success-green; + } + + &.failure { + background: $error-red; + } +} + .simple_form { &.hidden { display: none; -- cgit From 036ec18fb3bfc31404be2c6ccc2e390c64b0b5e5 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 10 Jun 2021 16:08:31 +0200 Subject: Fix WebUI crash when a toot with a playing video gets deleted Signed-off-by: Claire --- .../flavours/glitch/actions/picture_in_picture.js | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/actions/picture_in_picture.js b/app/javascript/flavours/glitch/actions/picture_in_picture.js index 4085cb59e..33d8d57d4 100644 --- a/app/javascript/flavours/glitch/actions/picture_in_picture.js +++ b/app/javascript/flavours/glitch/actions/picture_in_picture.js @@ -22,13 +22,20 @@ export const PICTURE_IN_PICTURE_REMOVE = 'PICTURE_IN_PICTURE_REMOVE'; * @param {MediaProps} props * @return {object} */ -export const deployPictureInPicture = (statusId, accountId, playerType, props) => ({ - type: PICTURE_IN_PICTURE_DEPLOY, - statusId, - accountId, - playerType, - props, -}); +export const deployPictureInPicture = (statusId, accountId, playerType, props) => { + return (dispatch, getState) => { + // Do not open a player for a toot that does not exist + if (getState().hasIn(['statuses', statusId])) { + dispatch({ + type: PICTURE_IN_PICTURE_DEPLOY, + statusId, + accountId, + playerType, + props, + }); + } + }; +}; /* * @return {object} -- cgit From f024f523b25d74c1cefbf4b019333c93b7d46af6 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 10 Jun 2021 15:51:20 +0200 Subject: Fix pop-up player not closing the moment a status is deleted Signed-off-by: Claire --- app/javascript/flavours/glitch/reducers/picture_in_picture.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/reducers/picture_in_picture.js b/app/javascript/flavours/glitch/reducers/picture_in_picture.js index f552a59c2..13a3d1aa2 100644 --- a/app/javascript/flavours/glitch/reducers/picture_in_picture.js +++ b/app/javascript/flavours/glitch/reducers/picture_in_picture.js @@ -1,4 +1,5 @@ import { PICTURE_IN_PICTURE_DEPLOY, PICTURE_IN_PICTURE_REMOVE } from 'flavours/glitch/actions/picture_in_picture'; +import { TIMELINE_DELETE } from 'flavours/glitch/actions/timelines'; const initialState = { statusId: null, @@ -16,6 +17,8 @@ export default function pictureInPicture(state = initialState, action) { return { statusId: action.statusId, accountId: action.accountId, type: action.playerType, ...action.props }; case PICTURE_IN_PICTURE_REMOVE: return { ...initialState }; + case TIMELINE_DELETE: + return (state.statusId === action.id) ? { ...initialState } : state; default: return state; } -- cgit From b6f952ec5b6ae18d332e12916df6b11da8b0d679 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 11 Jun 2021 17:52:22 +0200 Subject: [Glitch] Fix styling of boost button in media modal not reflecting ability to boost Port tootsuite#16387 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/styles/components/boost.scss | 12 ++++++++++++ app/javascript/flavours/glitch/styles/components/media.scss | 7 +++++++ 2 files changed, 19 insertions(+) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/styles/components/boost.scss b/app/javascript/flavours/glitch/styles/components/boost.scss index fb1451cb2..2969958e2 100644 --- a/app/javascript/flavours/glitch/styles/components/boost.scss +++ b/app/javascript/flavours/glitch/styles/components/boost.scss @@ -28,5 +28,17 @@ button.icon-button { i.fa-retweet { background-image: url("data:image/svg+xml;utf8,"); } + + &.reblogPrivate { + i.fa-retweet { + background-image: url("data:image/svg+xml;utf8,"); + } + } + + &.disabled { + i.fa-retweet { + background-image: url("data:image/svg+xml;utf8,"); + } + } } } diff --git a/app/javascript/flavours/glitch/styles/components/media.scss b/app/javascript/flavours/glitch/styles/components/media.scss index 88212457f..855cd07a9 100644 --- a/app/javascript/flavours/glitch/styles/components/media.scss +++ b/app/javascript/flavours/glitch/styles/components/media.scss @@ -320,6 +320,13 @@ background: rgba($gold-star, 0.3); } } + + &.disabled { + color: $white; + background-color: transparent; + cursor: default; + opacity: 0.4; + } } } } -- cgit From ba8f4535e3abfbd2f4dac95572877d976b65f0dd Mon Sep 17 00:00:00 2001 From: David Sterry Date: Sun, 27 Jun 2021 13:31:28 -0700 Subject: [Glitch] Hide /about/more footer link in limited federation mode Port 7c27ccb8d8fda060f3c5b234f7c81fc29b5fc915 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/ui/components/link_footer.js | 4 ++-- app/javascript/flavours/glitch/util/initial_state.js | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/ui/components/link_footer.js b/app/javascript/flavours/glitch/features/ui/components/link_footer.js index 4d7fc36c2..40ef506cc 100644 --- a/app/javascript/flavours/glitch/features/ui/components/link_footer.js +++ b/app/javascript/flavours/glitch/features/ui/components/link_footer.js @@ -3,7 +3,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; import { Link } from 'react-router-dom'; -import { invitesEnabled, version, repository, source_url } from 'flavours/glitch/util/initial_state'; +import { invitesEnabled, version, limitedFederationMode, repository, source_url } from 'flavours/glitch/util/initial_state'; import { signOutLink, securityLink } from 'flavours/glitch/util/backend_links'; import { logOut } from 'flavours/glitch/util/log_out'; import { openModal } from 'flavours/glitch/actions/modal'; @@ -47,7 +47,7 @@ class LinkFooter extends React.PureComponent {
    {invitesEnabled &&
  • ·
  • } {!!securityLink &&
  • ·
  • } -
  • ·
  • + {!limitedFederationMode &&
  • ·
  • }
  • ·
  • ·
  • ·
  • diff --git a/app/javascript/flavours/glitch/util/initial_state.js b/app/javascript/flavours/glitch/util/initial_state.js index 911468e6f..370d982d2 100644 --- a/app/javascript/flavours/glitch/util/initial_state.js +++ b/app/javascript/flavours/glitch/util/initial_state.js @@ -24,6 +24,7 @@ export const searchEnabled = getMeta('search_enabled'); export const maxChars = (initialState && initialState.max_toot_chars) || 500; export const pollLimits = (initialState && initialState.poll_limits); export const invitesEnabled = getMeta('invites_enabled'); +export const limitedFederationMode = getMeta('limited_federation_mode'); export const version = getMeta('version'); export const mascot = getMeta('mascot'); export const profile_directory = getMeta('profile_directory'); -- cgit