mirror of
https://github.com/nebulousnessie/Obsidian-MOCBlocks.git
synced 2026-07-22 06:44:20 +00:00
fixed typings errors
This commit is contained in:
parent
3e29be1ecd
commit
d430bfb4e8
3 changed files with 10 additions and 4 deletions
|
|
@ -71,7 +71,7 @@ export function addPinButton(
|
|||
percentY,
|
||||
async (newMarker) => {
|
||||
await addMarkerToFile(app.vault, markerFilePath, newMarker);
|
||||
await refreshMOCBlock(app, source, el, ctx);
|
||||
await refreshMOCBlock(app, source, el, ctx, parentComponent);
|
||||
app.workspace.trigger("markdown-code-block-processed");
|
||||
},
|
||||
cleanup // call cleanup on cancel
|
||||
|
|
@ -223,7 +223,7 @@ export function addPolylineButton(
|
|||
newMarker.type = "polyline";
|
||||
newMarker.points = points; // normalized percentages, for scaling
|
||||
await addMarkerToFile(app.vault, markerFilePath, newMarker);
|
||||
await refreshMOCBlock(app, source, el, ctx);
|
||||
await refreshMOCBlock(app, source, el, ctx, parentComponent);
|
||||
app.workspace.trigger("markdown-code-block-processed");
|
||||
},
|
||||
cleanup // call cleanup on cancel
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ export async function deleteMarkerFromFile(
|
|||
//console.log("🗑️ Marker deleted:", markerId);
|
||||
}
|
||||
|
||||
export async function renameDataFolder(this: { app: App }, oldPath: string, newPath: string) {
|
||||
export async function renameDataFolder(app: App, oldPath: string, newPath: string) {
|
||||
const oldFolder = app.vault.getAbstractFileByPath(oldPath);
|
||||
const newFolder = app.vault.getAbstractFileByPath(newPath);
|
||||
if (oldFolder && oldPath !== newPath) {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,12 @@ export const DEFAULT_SETTINGS: MOCBlockSettings = {
|
|||
|
||||
export class MOCBlockSettingTab extends PluginSettingTab {
|
||||
plugin: MOCBlockPlugin;
|
||||
|
||||
constructor(app: App, plugin: MOCBlockPlugin) {
|
||||
super(app, plugin);
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
display(): void {
|
||||
const { containerEl } = this;
|
||||
containerEl.empty();
|
||||
|
|
@ -57,7 +63,7 @@ export class MOCBlockSettingTab extends PluginSettingTab {
|
|||
const newPath = normalizePath(pendingValue || "MOCData");
|
||||
this.plugin.settings.dataFolder = newPath;
|
||||
await this.plugin.saveSettings();
|
||||
await renameDataFolder(oldPath, newPath);
|
||||
await renameDataFolder(this.app, oldPath, newPath);
|
||||
|
||||
// Create the folder if it doesn't exist
|
||||
const folderExists = await this.app.vault.adapter.exists(newPath);
|
||||
|
|
|
|||
Loading…
Reference in a new issue