0 ? attachments.getIn(index - 1, 'id') : null} onLoadMore={this.handleLoadMore} />
) : (
-
+
))}
{loadOlder}
diff --git a/app/javascript/flavours/glitch/features/audio/index.jsx b/app/javascript/flavours/glitch/features/audio/index.jsx
index 80c8af134..832ea6b63 100644
--- a/app/javascript/flavours/glitch/features/audio/index.jsx
+++ b/app/javascript/flavours/glitch/features/audio/index.jsx
@@ -12,7 +12,7 @@ import { throttle, debounce } from 'lodash';
import { Blurhash } from 'flavours/glitch/components/blurhash';
import { Icon } from 'flavours/glitch/components/icon';
import { formatTime, getPointerPosition, fileNameFromURL } from 'flavours/glitch/features/video';
-import { displayMedia, useBlurhash } from 'flavours/glitch/initial_state';
+import { displayMedia } from 'flavours/glitch/initial_state';
import Visualizer from './visualizer';
@@ -56,6 +56,7 @@ class Audio extends PureComponent {
volume: PropTypes.number,
muted: PropTypes.bool,
deployPictureInPicture: PropTypes.func,
+ useBlurhash: PropTypes.bool,
};
state = {
@@ -472,7 +473,7 @@ class Audio extends PureComponent {
};
render () {
- const { src, intl, alt, lang, editable, autoPlay, sensitive, blurhash } = this.props;
+ const { src, intl, alt, lang, editable, autoPlay, sensitive, blurhash, useBlurhash } = this.props;
const { paused, volume, currentTime, duration, buffer, dragging, revealed } = this.state;
const progress = Math.min((currentTime / duration) * 100, 100);
const muted = this.state.muted || volume === 0;
diff --git a/app/javascript/flavours/glitch/features/local_settings/page/index.jsx b/app/javascript/flavours/glitch/features/local_settings/page/index.jsx
index d8e6d6a26..3f874f255 100644
--- a/app/javascript/flavours/glitch/features/local_settings/page/index.jsx
+++ b/app/javascript/flavours/glitch/features/local_settings/page/index.jsx
@@ -466,6 +466,14 @@ class LocalSettingsPage extends PureComponent {
({ intl, onChange, settings }) => (
+
+
+
{
@@ -49,6 +48,7 @@ export default class Card extends PureComponent {
onOpenMedia: PropTypes.func.isRequired,
compact: PropTypes.bool,
sensitive: PropTypes.bool,
+ useBlurhash: PropTypes.bool,
};
static defaultProps = {
@@ -138,7 +138,7 @@ export default class Card extends PureComponent {
}
render () {
- const { card, compact } = this.props;
+ const { card, compact, useBlurhash } = this.props;
const { embedded, revealed } = this.state;
if (card === null) {
diff --git a/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx b/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx
index 57664c780..203c185c6 100644
--- a/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx
+++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.jsx
@@ -185,6 +185,7 @@ class DetailedStatus extends ImmutablePureComponent {
blurhash={attachment.get('blurhash')}
height={150}
onToggleVisibility={this.props.onToggleMediaVisibility}
+ useBlurhash={settings.getIn(['media', 'use_blurhash'])}
/>,
);
mediaIcons.push('music');
@@ -209,6 +210,7 @@ class DetailedStatus extends ImmutablePureComponent {
autoplay
visible={this.props.showMedia}
onToggleVisibility={this.props.onToggleMediaVisibility}
+ useBlurhash={settings.getIn(['media', 'use_blurhash'])}
/>,
);
mediaIcons.push('video-camera');
@@ -225,12 +227,19 @@ class DetailedStatus extends ImmutablePureComponent {
onOpenMedia={this.props.onOpenMedia}
visible={this.props.showMedia}
onToggleVisibility={this.props.onToggleMediaVisibility}
+ useBlurhash={settings.getIn(['media', 'use_blurhash'])}
/>,
);
mediaIcons.push('picture-o');
}
} else if (status.get('card')) {
- media.push();
+ media.push(
+
+ );
mediaIcons.push('link');
}
diff --git a/app/javascript/flavours/glitch/features/video/index.jsx b/app/javascript/flavours/glitch/features/video/index.jsx
index 022f66269..dc2e9e16e 100644
--- a/app/javascript/flavours/glitch/features/video/index.jsx
+++ b/app/javascript/flavours/glitch/features/video/index.jsx
@@ -11,7 +11,7 @@ import { throttle } from 'lodash';
import { Blurhash } from 'flavours/glitch/components/blurhash';
import { Icon } from 'flavours/glitch/components/icon';
-import { displayMedia, useBlurhash } from 'flavours/glitch/initial_state';
+import { displayMedia } from 'flavours/glitch/initial_state';
import { isFullscreen, requestFullscreen, exitFullscreen } from '../ui/util/fullscreen';
@@ -129,6 +129,7 @@ class Video extends PureComponent {
muted: PropTypes.bool,
componentIndex: PropTypes.number,
autoFocus: PropTypes.bool,
+ useBlurhash: PropTypes.bool,
};
static defaultProps = {
@@ -509,8 +510,35 @@ class Video extends PureComponent {
}
render () {
- const { preview, src, inline, onOpenVideo, onCloseVideo, intl, alt, lang, letterbox, fullwidth, detailed, sensitive, editable, blurhash, autoFocus } = this.props;
- const { currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, revealed } = this.state;
+ const {
+ preview,
+ src,
+ inline,
+ onOpenVideo,
+ onCloseVideo,
+ intl,
+ alt,
+ lang,
+ letterbox,
+ fullwidth,
+ detailed,
+ sensitive,
+ editable,
+ blurhash,
+ autoFocus,
+ useBlurhash
+ } = this.props;
+ const {
+ currentTime,
+ duration,
+ volume,
+ buffer,
+ dragging,
+ paused,
+ fullscreen,
+ hovered,
+ revealed
+ } = this.state;
const progress = Math.min((currentTime / duration) * 100, 100);
const muted = this.state.muted || volume === 0;
diff --git a/app/javascript/flavours/glitch/initial_state.js b/app/javascript/flavours/glitch/initial_state.js
index 5eabc4da9..9a8e50dd6 100644
--- a/app/javascript/flavours/glitch/initial_state.js
+++ b/app/javascript/flavours/glitch/initial_state.js
@@ -79,7 +79,6 @@
* @property {boolean} show_trends
* @property {boolean} trends_as_landing_page
* @property {boolean} unfollow_modal
- * @property {boolean} use_blurhash
* @property {boolean=} use_pending_items
* @property {string} version
* @property {string} sso_redirect
@@ -158,7 +157,6 @@ export const timelinePreview = getMeta('timeline_preview');
export const title = getMeta('title');
export const trendsAsLanding = getMeta('trends_as_landing_page');
export const unfollowModal = getMeta('unfollow_modal');
-export const useBlurhash = getMeta('use_blurhash');
export const usePendingItems = getMeta('use_pending_items');
export const version = getMeta('version');
export const languages = initialState?.languages;
diff --git a/app/javascript/flavours/glitch/reducers/local_settings.js b/app/javascript/flavours/glitch/reducers/local_settings.js
index 96a3938c0..39a910ef6 100644
--- a/app/javascript/flavours/glitch/reducers/local_settings.js
+++ b/app/javascript/flavours/glitch/reducers/local_settings.js
@@ -45,6 +45,7 @@ const initialState = ImmutableMap({
show_action_bar : true,
}),
media : ImmutableMap({
+ use_blurhash : true,
letterbox : false,
fullwidth : true,
reveal_behind_cw : false,