Skip to content

Commit

Permalink
fix deleteRecord
Browse files Browse the repository at this point in the history
  • Loading branch information
josheverett committed Apr 16, 2022
1 parent 7e6d605 commit 5e1a22f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions iseentit.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,12 @@ async function upsertRecord (node, metadata) {
async function deleteRecord (node, metadata) {
const detailMetadata =
await fetchMetadataFromDetailPage(metadata.platform, node);
const existingRecord = SYNC_DATA[metadata.type].find((record) => {
return record[0] === detailMetadata.year && record[1] === metadata.title;
const existingRecord = SYNC_DATA[detailMetadata.type].find((record) => {
return (
record[0] === detailMetadata.year && record[1] === detailMetadata.title);
});
const index = SYNC_DATA[metadata.type].indexOf(existingRecord);
SYNC_DATA[metadata.type].splice(index, 1);
const index = SYNC_DATA[detailMetadata.type].indexOf(existingRecord);
SYNC_DATA[detailMetadata.type].splice(index, 1);
return await chrome.storage.sync.set({ 'iseentit': SYNC_DATA });
}

Expand Down

0 comments on commit 5e1a22f

Please sign in to comment.