carry over tags when refetching csv metadata (#3938)

This commit is contained in:
llama 2025-04-24 17:18:57 +08:00 committed by GitHub
parent a2e0060470
commit b5f15491a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,6 +99,7 @@ export class ImportCsvState {
const shouldRefetchMetadata = this.shouldRefetchMetadata(changed); const shouldRefetchMetadata = this.shouldRefetchMetadata(changed);
if (shouldRefetchMetadata) { if (shouldRefetchMetadata) {
const { globalTags, updatedTags } = changed;
changed = await getCsvMetadata({ changed = await getCsvMetadata({
path: this.path, path: this.path,
delimiter: changed.delimiter, delimiter: changed.delimiter,
@ -106,6 +107,9 @@ export class ImportCsvState {
deckId: getDeckId(changed) ?? undefined, deckId: getDeckId(changed) ?? undefined,
isHtml: changed.isHtml, isHtml: changed.isHtml,
}); });
// carry over tags
changed.globalTags = globalTags;
changed.updatedTags = updatedTags;
} }
const globalNotetype = getGlobalNotetype(changed); const globalNotetype = getGlobalNotetype(changed);