Skip to content

Commit

Permalink
remove tags from internal array
Browse files Browse the repository at this point in the history
increase limit to 10000
  • Loading branch information
ElectronicBlueberry committed Feb 15, 2024
1 parent bb50bd2 commit c028ff7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/src/stores/userTagsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class UserTagStoreDatabase extends Dexie {
}
}

const maxDbEntriesPerUser = 500;
const maxDbEntriesPerUser = 10000;

function normalizeTag(tag: string) {
return tag.replace(/^name:/, "#");
Expand Down Expand Up @@ -58,7 +58,7 @@ export const useUserTagsStore = defineStore("userTagsStore", () => {

/** removes the x oldest tags from the database */
async function removeOldestEntries(count: number) {
const oldestTags = tags.value.filter((o) => o.id !== undefined).splice(0, count);
const oldestTags = tags.value.splice(0, count);
await db.tags.bulkDelete(oldestTags.map((o) => o.id!));
}

Expand Down

0 comments on commit c028ff7

Please sign in to comment.