js/main.js
// add filter effect to the specified card
add filter effect to the specified card
add filter effect to the specified card
async function filterCard (card) {
  const id = getId(card)
  if (id === '') return
  const poster = postersForIds.get(id)
  if (poster !== undefined) {
    await new Promise((resolve, reject) => {
      try {
        applyFilter(poster, card)
        resolve()
      } catch (e) {
        reject(e)
      }
    })
  } else {
    await getPoster(id).then(poster => {
      postersForIds.set(id, poster)
      applyFilter(poster, card)
    })
  }
}
async function filterCard ( card ) { const id = getId ( card ) if ( id === '' ) return const poster = postersForIds . get ( id ) if ( poster !== undefined ) { await new Promise ( ( resolve , reject ) => { try { applyFilter ( poster , card ) resolve ( ) } catch ( e ) { reject ( e ) } } ) } else { await getPoster ( id ) . then ( poster => { postersForIds . set ( id , poster ) applyFilter ( poster , card ) } ) } }
add filter effect to the specified card
add filter effect to the specified card
// poster for the card is already fetched // fetch poster for the card