Skip to content

Commit eecdac0

Browse files
committed
Unify tag name handling
Ensures legacy tag names with underscores are consistently converted to spaces across all storage listeners, not just during initialization.
1 parent 0a53bb7 commit eecdac0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/background.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ messenger.storage.onChanged.addListener((changes, area) => {
339339
selectedTags = changes.selectedTags.newValue.map(tagKey =>
340340
// Wenn selectedTags von Storage kommt, ist es ein Tag-Key.
341341
tagKeyToNameMap[tagKey] ? tagKeyToNameMap[tagKey] : tagKey // Hole den tatsächlichen Tag-Namen
342-
);
342+
).map(tagName => tagName.replace(/_/g, ' ')); // Konsistenz mit initialize()
343343
// Aktualisiere die Tags und Mappings
344344
messenger.messages.listTags().then((tags) => {
345345
allTags = tags;
@@ -1035,7 +1035,7 @@ messenger.runtime.onMessage.addListener((message, sender, sendResponse) => {
10351035
selectedTags = selectedTags.map(tagKey =>
10361036
// Konvertiere Tag-Keys aus dem Storage zurück in die ursprünglichen Tag-Namen (mit Leerzeichen)
10371037
tagKeyToNameMap[tagKey] ? tagKeyToNameMap[tagKey] : tagKey
1038-
);
1038+
).map(tagName => tagName.replace(/_/g, ' ')); // Konsistenz mit initialize()
10391039
selectedAccounts = result.selectedAccounts || [];
10401040

10411041
// Aktualisiere die Tags und Mappings

0 commit comments

Comments
 (0)