mirror of
https://github.com/devonthesofa/obsidian-note-status.git
synced 2026-07-22 05:45:04 +00:00
fix: write mapped statuses to every configured tag per template
This commit is contained in:
parent
82f277e66b
commit
298deddf9d
1 changed files with 16 additions and 19 deletions
|
|
@ -83,28 +83,25 @@ export const resolveFrontmatterKeysForStatus = (
|
|||
|
||||
const scoped = toScopedStatusName(status);
|
||||
const mappings = settings.statusFrontmatterMappings ?? [];
|
||||
const collectedKeys: string[] = [];
|
||||
|
||||
const statusMapping = mappings.find(
|
||||
(mapping) =>
|
||||
mapping.scope === "status" && matchesStatusMapping(mapping, scoped),
|
||||
);
|
||||
if (statusMapping) {
|
||||
const keys = getMappingKeys(statusMapping);
|
||||
if (keys.length) {
|
||||
return keys;
|
||||
mappings.forEach((mapping) => {
|
||||
if (mapping.scope === "status") {
|
||||
if (!matchesStatusMapping(mapping, scoped)) {
|
||||
return;
|
||||
}
|
||||
} else if (mapping.scope === "template") {
|
||||
if (!matchesStatusMapping(mapping, scoped)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const templateMapping = mappings.find(
|
||||
(mapping) =>
|
||||
mapping.scope === "template" &&
|
||||
matchesStatusMapping(mapping, scoped),
|
||||
);
|
||||
if (templateMapping) {
|
||||
const keys = getMappingKeys(templateMapping);
|
||||
if (keys.length) {
|
||||
return keys;
|
||||
}
|
||||
const keys = getMappingKeys(mapping);
|
||||
collectedKeys.push(...keys);
|
||||
});
|
||||
|
||||
if (collectedKeys.length) {
|
||||
return normalizeKeys(collectedKeys);
|
||||
}
|
||||
|
||||
return [settings.tagPrefix];
|
||||
|
|
|
|||
Loading…
Reference in a new issue