Skip to content

Commit

Permalink
stop writing out starforged truths if SI is enabled (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat authored Jul 13, 2024
1 parent b36a8e9 commit 82aa76a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/truths/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@ import { getExistingOrNewFolder } from "utils/obsidian";
import { FolderTextSuggest } from "utils/ui/settings/folder";

export async function generateTruthsCommand(plugin: IronVaultPlugin) {
const truths = [...plugin.datastore.truths.values()];
const truths = [...plugin.datastore.truths.values()].filter((truth) => {
// HACK(@zkat): This is a quick fix for
// https://github.com/iron-vault-plugin/iron-vault/issues/337. What we
// actually want to do here is to use Playsets to filter out truths as
// needed.
if (
plugin.settings.enableStarforged &&
plugin.settings.enableSunderedIsles &&
truth._id.startsWith("truth:starforged")
) {
return false;
}
return true;
});
const text = Handlebars.compile(
`{{#each truths}}\n## {{name}}\n\`\`\`iron-vault-truth\n{{_id}}\n\`\`\`\n\n{{/each}}`,
)({ truths });
Expand Down

0 comments on commit 82aa76a

Please sign in to comment.