conditional access
This commit is contained in:
parent
9ac73aaf66
commit
a69c754a56
|
@ -71,7 +71,7 @@ export default function Edit({attributes, setAttributes}) {
|
|||
<div {...useBlockProps()}>
|
||||
<p>Results for tournament id {attributes.tournament_id}</p>
|
||||
<button onClick={() => fetchTournamentData()}>Fetch Results</button>
|
||||
{attributes.data.players && attributes.data.standings && (
|
||||
{attributes.data?.players && attributes.data?.standings && (
|
||||
<>
|
||||
<table id="tournament-results-table">
|
||||
<thead>
|
||||
|
|
|
@ -14,7 +14,7 @@ export default function save( { attributes } ) {
|
|||
const blockProps = useBlockProps.save();
|
||||
return (
|
||||
<div { ...blockProps } data-tournament-id={ attributes.tournament_id }>
|
||||
{attributes.data.players && attributes.data.standings && (
|
||||
{attributes.data?.players && attributes.data?.standings && (
|
||||
<table id="tournament-results-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
Loading…
Reference in New Issue