Clear play queue on login and logout

This commit is contained in:
Deluan
2020-06-19 10:51:39 -04:00
parent 9d23b191b5
commit 804d969427
6 changed files with 87 additions and 47 deletions
+15
View File
@@ -0,0 +1,15 @@
import React, { useCallback } from 'react'
import { useDispatch } from 'react-redux'
import { Logout } from 'react-admin'
import { clearQueue } from '../audioplayer'
export default (props) => {
const dispatch = useDispatch()
const handleClick = useCallback(() => dispatch(clearQueue()), [dispatch])
return (
<span onClick={handleClick}>
<Logout {...props} />
</span>
)
}