diff --git a/backend/routes.js b/backend/routes.js index 556907a870..6978cb74ae 100644 --- a/backend/routes.js +++ b/backend/routes.js @@ -423,7 +423,7 @@ route.POST('/deleteFile/{hash}', { const existingResources = await sbp('chelonia/db/get', resourcesKey) if (!existingResources) return if (existingResources.endsWith(hash)) { - await sbp('chelonia/db/set', resourcesKey, existingResources.slice(0, hash.length + 1)) + await sbp('chelonia/db/set', resourcesKey, existingResources.slice(0, -hash.length - 1)) return } const hashIndex = existingResources.indexOf(hash + '\x00')