From dd567cd9c1f43e47bbf3c7e9af1c5f5ebc20f3ce Mon Sep 17 00:00:00 2001 From: Rafael Araujo Lehmkuhl Date: Tue, 20 Feb 2024 18:22:44 -0300 Subject: [PATCH] video: Fix `clearTemporaryVideoDB` method --- src/stores/video.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/stores/video.ts b/src/stores/video.ts index 28967dac4..073eb068f 100644 --- a/src/stores/video.ts +++ b/src/stores/video.ts @@ -257,9 +257,13 @@ export const useVideoStore = defineStore('video', () => { // Used to clear the temporary video database const clearTemporaryVideoDB = async (): Promise => { - await tempVideoChunksDB.iterate((_, chunkName) => { - tempVideoChunksDB.removeItem(chunkName) + const tempChunks: string[] = [] + await videoStoringDB.iterate((_, name) => { + tempChunks.push(name) }) + for (const chunk of tempChunks) { + await videoStoringDB.removeItem(chunk) + } } // Used to store chunks of an ongoing recording, that will be merged into a video file when the recording is stopped