]> cat aescling's git repositories - mastodon.git/commitdiff
Add setting to disable the pop-in player
authorThibaut Girka <thib@sitedethib.com>
Mon, 26 Oct 2020 19:11:35 +0000 (20:11 +0100)
committerThibaut Girka <thib@sitedethib.com>
Mon, 26 Oct 2020 19:31:54 +0000 (20:31 +0100)
app/javascript/flavours/glitch/containers/status_container.js
app/javascript/flavours/glitch/features/local_settings/page/index.js
app/javascript/flavours/glitch/reducers/local_settings.js

index 48b0d82551b829d4bcc5277f252912f38af318a0..ac423c58db07feeff14cb84a49e6f054e1fd92b4 100644 (file)
@@ -248,7 +248,11 @@ const mapDispatchToProps = (dispatch, { intl, contextType }) => ({
   },
 
   deployPictureInPicture (status, type, mediaProps) {
-    dispatch(deployPictureInPicture(status.get('id'), status.getIn(['account', 'id']), type, mediaProps));
+    dispatch((_, getState) => {
+      if (getState().getIn(['local_settings', 'media', 'pop_in_player'])) {
+        dispatch(deployPictureInPicture(status.get('id'), status.getIn(['account', 'id']), type, mediaProps));
+      }
+    });
   },
 
 });
index 0b34280275855ecf272239fc344ebaf7e9377e52..bce45901e2201231dab2382af31da3261db49799 100644 (file)
@@ -420,6 +420,14 @@ class LocalSettingsPage extends React.PureComponent {
         >
           <FormattedMessage id='settings.media_reveal_behind_cw' defaultMessage='Reveal sensitive media behind a CW by default' />
         </LocalSettingsPageItem>
+        <LocalSettingsPageItem
+          settings={settings}
+          item={['media', 'pop_in_player']}
+          id='mastodon-settings--pop-in-player'
+          onChange={onChange}
+        >
+          <FormattedMessage id='settings.pop_in_player' defaultMessage='Enable pop-in player' />
+        </LocalSettingsPageItem>
       </div>
     ),
   ];
index 3d94d665c2264d8386ea46aec0e2f8322015f762..e4df22b9f6d14072faf8225b84f283955b98be0b 100644 (file)
@@ -49,6 +49,7 @@ const initialState = ImmutableMap({
     letterbox        : true,
     fullwidth        : true,
     reveal_behind_cw : false,
+    pop_in_player    : true,
   }),
   notifications : ImmutableMap({
     favicon_badge : false,