Skip to content

Commit

Permalink
Fix Filter Delete Button
Browse files Browse the repository at this point in the history
  • Loading branch information
smashedr committed Aug 16, 2024
1 parent 5cb9f24 commit 103fb5c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/js/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,16 @@ async function addFilter(event) {
* Delete Filter
* @function deleteFilter
* @param {MouseEvent} event
* @param {String} index
* @param {String} [index]
*/
async function deleteFilter(event, index = undefined) {
console.debug('deleteFilter:', event)
console.debug('deleteFilter:', index, event)
event.preventDefault()
const filter = event.currentTarget?.dataset?.value
const { patterns } = await chrome.storage.sync.get(['patterns'])
// console.debug('patterns:', patterns)
if (!index) {
// const anchor = event.target.closest('a')
const filter = event.currentTarget?.dataset?.value
console.log(`filter: ${filter}`)
if (filter && patterns.includes(filter)) {
index = patterns.indexOf(filter)
Expand Down

0 comments on commit 103fb5c

Please sign in to comment.