Fixed a issue while deleting categories - Polishing UI
This commit is contained in:
3
main.ts
3
main.ts
@@ -1,4 +1,4 @@
|
||||
import { Plugin } from "obsidian";
|
||||
import { Plugin, Notice } from "obsidian";
|
||||
import { TaskWeaverView, VIEW_TYPE_TASKWEAVER } from "./view";
|
||||
import { TaskWeaverSettingTab } from "./settings";
|
||||
import { TaskWeaverSettings, DEFAULT_SETTINGS, Task, Category } from "./types";
|
||||
@@ -91,6 +91,7 @@ export default class TaskWeaverPlugin extends Plugin {
|
||||
async deleteCategory(categoryId: string): Promise<void> {
|
||||
const hasTasks = this.settings.tasks.some(t => t.categoryId === categoryId);
|
||||
if (hasTasks) {
|
||||
new Notice("Cannot delete category: it still contains tasks. Please delete or move all tasks first.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user