Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/mappings/content/commentsAndReactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ async function processVideoReaction(
--previousReactionTypeCounter.count
// remove reaction
videoReactionRepository.remove(existingReaction)
await overlay.updateDatabase()
return
}
// otherwise...
Expand Down Expand Up @@ -370,6 +371,7 @@ export async function processReactCommentMessage(
--comment.reactionsCount
// remove reaction
commentReactionRepository.remove(existingReaction)
await overlay.updateDatabase()
} else {
// new reaction
const id = commentReactionEntityId({ memberId, commentId, reactionId })
Expand Down
2 changes: 2 additions & 0 deletions src/mappings/content/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ export async function deleteChannel(overlay: EntityManagerOverlay, channelId: bi

overlay.getRepository(BannedMember).remove(...bannedMembers)
overlay.getRepository(Channel).remove(channelId.toString())
await overlay.updateDatabase()
// delete channel related notifications
}

Expand Down Expand Up @@ -204,6 +205,7 @@ export async function deleteVideo(overlay: EntityManagerOverlay, videoId: bigint
}
subtitlesRepository.remove(...subtitles)
videoRepository.remove(video)
await overlay.updateDatabase()
}

export async function processNft(
Expand Down
5 changes: 4 additions & 1 deletion src/mappings/token/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,13 @@ export async function processTokenMetadata(
token.description = metadata.description
}

// remove all current bnefits
// remove all current benefits
const existingBenefit = await overlay
.getRepository(Benefit)
.getManyByRelation('tokenId', token.id)
if (existingBenefit !== undefined) {
overlay.getRepository(Benefit).remove(...existingBenefit)
await overlay.updateDatabase()
}

if (isSet(metadata.benefits)) {
Expand Down Expand Up @@ -302,6 +303,7 @@ export async function processTokenMetadata(
}
if (oldTrailer) {
trailerVideoRepository.remove(oldTrailer)
await overlay.updateDatabase()
}

const id = overlay.getRepository(TrailerVideo).getNewEntityId()
Expand All @@ -316,6 +318,7 @@ export async function processTokenMetadata(
const oldTrailer = await trailerVideoRepository.getOneByRelation('tokenId', token.id)
if (oldTrailer) {
trailerVideoRepository.remove(oldTrailer)
await overlay.updateDatabase()
}
}
}
Expand Down
Loading