mirror of
https://github.com/cloudreve/frontend.git
synced 2025-12-25 19:52:48 +00:00
fix(music player): cannot preview audio in single file shares (https://github.com/cloudreve/Cloudreve/issues/1541)
This commit is contained in:
parent
f87530a95e
commit
df3e4bfb82
|
|
@ -103,6 +103,9 @@ class MusicPlayerComponent extends Component {
|
|||
//isOpen: true,
|
||||
});
|
||||
this.props.audioPreviewSetIsOpen(true);
|
||||
this.props.showAudioPreview(
|
||||
explorer.initState.audioPreview.first
|
||||
);
|
||||
return;
|
||||
}
|
||||
// eslint-disable-next-line
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ import {
|
|||
openMusicDialog,
|
||||
openResaveDialog,
|
||||
setSelectedTarget,
|
||||
showAudioPreview,
|
||||
showImgPreivew,
|
||||
toggleSnackbar,
|
||||
} from "../../redux/explorer";
|
||||
|
|
@ -105,8 +106,8 @@ const mapDispatchToProps = (dispatch) => {
|
|||
toggleSnackbar: (vertical, horizontal, msg, color) => {
|
||||
dispatch(toggleSnackbar(vertical, horizontal, msg, color));
|
||||
},
|
||||
openMusicDialog: () => {
|
||||
dispatch(openMusicDialog());
|
||||
openMusicDialog: (first) => {
|
||||
dispatch(showAudioPreview(first));
|
||||
},
|
||||
setSelectedTarget: (targets) => {
|
||||
dispatch(setSelectedTarget(targets));
|
||||
|
|
@ -166,13 +167,11 @@ class SharedFileCompoment extends Component {
|
|||
);
|
||||
return;
|
||||
case "audio":
|
||||
this.props.setSelectedTarget([
|
||||
{
|
||||
key: this.props.share.key,
|
||||
type: "share",
|
||||
},
|
||||
]);
|
||||
this.props.openMusicDialog();
|
||||
this.props.openMusicDialog({
|
||||
key: this.props.share.key,
|
||||
name: this.props.share.source.name,
|
||||
type: "share",
|
||||
});
|
||||
return;
|
||||
case "video":
|
||||
this.props.history.push(
|
||||
|
|
|
|||
Loading…
Reference in New Issue