Don't explode when `record` is not loaded yet

This commit is contained in:
Deluan 2020-11-28 09:44:07 -05:00
parent 4ca98fb827
commit 7becc18da9
1 changed files with 1 additions and 1 deletions

View File

@ -2,7 +2,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'
import { useDataProvider, useNotify } from 'react-admin'
import subsonic from '../subsonic'
export const useToggleStar = (resource, record) => {
export const useToggleStar = (resource, record = {}) => {
const [loading, setLoading] = useState(false)
const notify = useNotify()