From 258171549120142a6a7dac40f17ecc2087433f4a Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 8 Jul 2020 09:22:23 +0200 Subject: Fix WebUI crash on sensitive preview card with no preview thumbnail (#14260) Fixes #14257 --- app/javascript/mastodon/features/status/components/card.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/javascript/mastodon/features/status/components/card.js b/app/javascript/mastodon/features/status/components/card.js index 0af7c54e4..0a84e481a 100644 --- a/app/javascript/mastodon/features/status/components/card.js +++ b/app/javascript/mastodon/features/status/components/card.js @@ -106,7 +106,7 @@ export default class Card extends React.PureComponent { componentDidUpdate (prevProps) { const { card } = this.props; - if (card.get('blurhash') && (!prevProps.card || prevProps.card.get('blurhash') !== card.get('blurhash'))) { + if (card.get('blurhash') && (!prevProps.card || prevProps.card.get('blurhash') !== card.get('blurhash')) && this.canvas) { this._decode(); } } -- cgit From d308a863fbd373b94fa571103ad431782c29e074 Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 8 Jul 2020 12:58:17 +0200 Subject: Fix WebUI crash on sensitive preview card with no preview thumbnail (#14261) Follow-up on #14260 which only fixed half the call sites --- app/javascript/mastodon/features/status/components/card.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/javascript/mastodon/features/status/components/card.js b/app/javascript/mastodon/features/status/components/card.js index 0a84e481a..971682df8 100644 --- a/app/javascript/mastodon/features/status/components/card.js +++ b/app/javascript/mastodon/features/status/components/card.js @@ -94,7 +94,7 @@ export default class Card extends React.PureComponent { componentDidMount () { window.addEventListener('resize', this.handleResize, { passive: true }); - if (this.props.card && this.props.card.get('blurhash')) { + if (this.props.card && this.props.card.get('blurhash') && this.canvas) { this._decode(); } } -- cgit From 0d2135a46172fd6931f757ef083ad99f4522081d Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 8 Jul 2020 14:54:47 +0200 Subject: Fix new accent color not refreshing when changing thumbnail for audio uploads (#14264) --- app/javascript/mastodon/features/audio/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/javascript/mastodon/features/audio/index.js b/app/javascript/mastodon/features/audio/index.js index 686709ac3..f0cd79873 100644 --- a/app/javascript/mastodon/features/audio/index.js +++ b/app/javascript/mastodon/features/audio/index.js @@ -103,7 +103,7 @@ class Audio extends React.PureComponent { } componentDidUpdate (prevProps, prevState) { - if (prevProps.src !== this.props.src || this.state.width !== prevState.width || this.state.height !== prevState.height) { + if (prevProps.src !== this.props.src || this.state.width !== prevState.width || this.state.height !== prevState.height || prevProps.accentColor !== this.props.accentColor) { this._clear(); this._draw(); } -- cgit From a513997367b050028f3ad6e9a0bff46346b5b832 Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 8 Jul 2020 09:22:23 +0200 Subject: [Glitch] Fix WebUI crash on sensitive preview card with no preview thumbnail Port 258171549120142a6a7dac40f17ecc2087433f4a to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/features/status/components/card.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/javascript/flavours/glitch/features/status/components/card.js b/app/javascript/flavours/glitch/features/status/components/card.js index 4b6676062..b4db62f4a 100644 --- a/app/javascript/flavours/glitch/features/status/components/card.js +++ b/app/javascript/flavours/glitch/features/status/components/card.js @@ -98,7 +98,7 @@ export default class Card extends React.PureComponent { componentDidUpdate (prevProps) { const { card } = this.props; - if (card.get('blurhash') && (!prevProps.card || prevProps.card.get('blurhash') !== card.get('blurhash'))) { + if (card.get('blurhash') && (!prevProps.card || prevProps.card.get('blurhash') !== card.get('blurhash')) && this.canvas) { this._decode(); } } -- cgit From b27eecdbfcebc46c8e29c6b834b9c8b25ddfa751 Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 8 Jul 2020 12:58:17 +0200 Subject: [Glitch] Fix WebUI crash on sensitive preview card with no preview thumbnail Port d308a863fbd373b94fa571103ad431782c29e074 to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/features/status/components/card.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/javascript/flavours/glitch/features/status/components/card.js b/app/javascript/flavours/glitch/features/status/components/card.js index b4db62f4a..ab6398e1a 100644 --- a/app/javascript/flavours/glitch/features/status/components/card.js +++ b/app/javascript/flavours/glitch/features/status/components/card.js @@ -86,7 +86,7 @@ export default class Card extends React.PureComponent { componentDidMount () { window.addEventListener('resize', this.handleResize, { passive: true }); - if (this.props.card && this.props.card.get('blurhash')) { + if (this.props.card && this.props.card.get('blurhash') && this.canvas) { this._decode(); } } -- cgit From 11446be6d13f6d4748227a329dcc75c5c78c915d Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 8 Jul 2020 14:54:47 +0200 Subject: [Glitch] Fix new accent color not refreshing when changing thumbnail for audio uploads Port 0d2135a46172fd6931f757ef083ad99f4522081d to glitch-soc Signed-off-by: Thibaut Girka --- app/javascript/flavours/glitch/features/audio/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/javascript/flavours/glitch/features/audio/index.js b/app/javascript/flavours/glitch/features/audio/index.js index 181d8e980..d833e0fe9 100644 --- a/app/javascript/flavours/glitch/features/audio/index.js +++ b/app/javascript/flavours/glitch/features/audio/index.js @@ -102,7 +102,7 @@ class Audio extends React.PureComponent { } componentDidUpdate (prevProps, prevState) { - if (prevProps.src !== this.props.src || this.state.width !== prevState.width || this.state.height !== prevState.height) { + if (prevProps.src !== this.props.src || this.state.width !== prevState.width || this.state.height !== prevState.height || prevProps.accentColor !== this.props.accentColor) { this._clear(); this._draw(); } -- cgit