Skip to content

Commit

Permalink
store named tags in the format name:value
Browse files Browse the repository at this point in the history
  • Loading branch information
ElectronicBlueberry committed Feb 15, 2024
1 parent c028ff7 commit 1c69980
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ const filteredOptions = computed(() => {
/** options trimmed to `maxShownOptions` and reordered so the search value appears first */
const trimmedOptions = computed(() => {
const optionsSliced = filteredOptions.value.slice(0, props.maxShownOptions);
const optionsSliced = filteredOptions.value
.slice(0, props.maxShownOptions)
.map((tag) => tag.replace(/^name:/, "#"));
// remove search value to put it in front
const optionsSet = new Set(optionsSliced);
Expand Down
2 changes: 1 addition & 1 deletion client/src/stores/userTagsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class UserTagStoreDatabase extends Dexie {
const maxDbEntriesPerUser = 10000;

function normalizeTag(tag: string) {
return tag.replace(/^name:/, "#");
return tag.replace(/^#/, "name:");
}

export const useUserTagsStore = defineStore("userTagsStore", () => {
Expand Down

0 comments on commit 1c69980

Please sign in to comment.