diff options
author | Starfall <us@starfall.systems> | 2021-07-07 11:46:33 -0500 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2021-07-07 11:46:33 -0500 |
commit | d30025d28d813999bfe98ce9cee2cda3bebf6c22 (patch) | |
tree | e2cf70344fc6426f3a2c778d3b6d3bab9e22c078 /app/javascript/mastodon/actions | |
parent | fadb06ef6e1950a82f08673683e705943b93ba40 (diff) | |
parent | 0c2eb949fc21ceecbd99a81e5ffe75517a1e64df (diff) |
Merge branch 'glitch'
Diffstat (limited to 'app/javascript/mastodon/actions')
-rw-r--r-- | app/javascript/mastodon/actions/picture_in_picture.js | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/app/javascript/mastodon/actions/picture_in_picture.js b/app/javascript/mastodon/actions/picture_in_picture.js index 4085cb59e..33d8d57d4 100644 --- a/app/javascript/mastodon/actions/picture_in_picture.js +++ b/app/javascript/mastodon/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} |