Fixed pull release issues from github actions bot

This commit is contained in:
Ankit Kapur 2025-03-16 01:11:02 -07:00
parent df7d83050f
commit fb5acef605
3 changed files with 20 additions and 559 deletions

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
main.js
# Dependency directories
node_modules/

551
main.js

File diff suppressed because one or more lines are too long

26
main.ts
View file

@ -6,9 +6,20 @@ import {
PluginSettingTab,
Setting,
stringifyYaml,
WorkspaceLeaf
WorkspaceLeaf,
View
} from 'obsidian';
// Extended interfaces for Obsidian internal properties
interface ExtendedWorkspaceLeaf extends WorkspaceLeaf {
containerEl?: HTMLElement;
view: ExtendedView;
}
interface ExtendedView extends View {
contentEl?: HTMLElement;
}
interface KanbanStatusUpdaterSettings {
statusPropertyName: string;
showNotifications: boolean;
@ -117,8 +128,8 @@ export default class KanbanStatusUpdaterPlugin extends Plugin {
// First disconnect any existing observers
this.disconnectObservers();
// Get the active leaf
const activeLeaf = this.app.workspace.activeLeaf;
// Get the active leaf using the non-deprecated API
const activeLeaf = this.app.workspace.getLeaf(false);
if (!activeLeaf) return;
try {
@ -128,17 +139,16 @@ export default class KanbanStatusUpdaterPlugin extends Plugin {
// Use type assertions to avoid TypeScript errors
if (activeLeaf.view) {
// Try to access the contentEl property using type assertion
// @ts-ignore - contentEl exists but might not be in type definitions
contentEl = activeLeaf.view.contentEl;
contentEl = (activeLeaf as ExtendedWorkspaceLeaf).view.contentEl || null;
}
// If that didn't work, try another approach
if (!contentEl) {
// Try to get the Kanban board directly from the DOM
// Leaf containers have 'view-content' elements that contain the actual view
const viewContent = (activeLeaf as any).containerEl?.querySelector('.view-content');
const viewContent = (activeLeaf as ExtendedWorkspaceLeaf).containerEl?.querySelector('.view-content');
if (viewContent) {
contentEl = viewContent;
contentEl = viewContent as HTMLElement;
} else {
// Last resort - look for Kanban boards anywhere in the workspace
contentEl = document.querySelector('.workspace-leaf.mod-active .view-content');
@ -595,4 +605,4 @@ class KanbanStatusUpdaterSettingTab extends PluginSettingTab {
text: 'Keep Debug Mode disabled for best performance'
});
}
}
}