fix settings when no presets exist

This commit is contained in:
celeste 2023-11-20 19:18:05 -06:00
parent ab6180b725
commit 12e5d8cb5c
4 changed files with 12 additions and 2 deletions

View file

@ -1627,6 +1627,11 @@ class LoomSettingTab extends PluginSettingTab {
const updatePresetFields = () => {
presetFields.empty();
if (this.plugin.settings.modelPreset === -1) {
presetFields.createEl("p", { cls: "loom__no-preset-selected", text: "No preset selected." });
return;
}
new Setting(presetFields).setName("Name").addText((text) =>
text.setValue(this.plugin.settings.modelPresets[this.plugin.settings.modelPreset].name).onChange((value) => {
this.plugin.settings.modelPresets[this.plugin.settings.modelPreset].name = value;

View file

@ -1,7 +1,7 @@
{
"id": "loom",
"name": "Loom",
"version": "1.19.1",
"version": "1.19.2",
"minAppVersion": "0.15.0",
"description": "Loom in Obsidian",
"author": "celeste",

View file

@ -1,6 +1,6 @@
{
"name": "obsidian-loom",
"version": "1.19.1",
"version": "1.19.2",
"description": "Loom in Obsidian",
"main": "main.js",
"scripts": {

View file

@ -381,6 +381,11 @@ body {
margin-right: 0.5em;
}
.loom__no-preset-selected {
color: var(--text-faint);
font-size: var(--font-ui-small);
}
/* hidden -- must be at end */
.hidden {