mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-02-22 20:18:48 +00:00
### Fixed
- Resolving conflicts of JSON files (and sensibly merging them) is now working fine, again!
- And, failure logs are more informative.
- More robust to release the event listeners on unwatching the local database.
### Refactored
- JSON file conflict resolution dialogue has been rewritten into svelte v5.
- Upgrade eslint.
- Remove unnecessary pragma comments for eslint.
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import { ItemView, WorkspaceLeaf } from "obsidian";
|
|
import TestPaneComponent from "./TestPane.svelte";
|
|
import type ObsidianLiveSyncPlugin from "../../../main.ts";
|
|
import type { ModuleDev } from "../ModuleDev.ts";
|
|
export const VIEW_TYPE_TEST = "ols-pane-test";
|
|
//Log view
|
|
export class TestPaneView extends ItemView {
|
|
component?: TestPaneComponent;
|
|
plugin: ObsidianLiveSyncPlugin;
|
|
moduleDev: ModuleDev;
|
|
icon = "view-log";
|
|
title: string = "Self-hosted LiveSync Test and Results";
|
|
navigation = true;
|
|
|
|
getIcon(): string {
|
|
return "view-log";
|
|
}
|
|
|
|
constructor(leaf: WorkspaceLeaf, plugin: ObsidianLiveSyncPlugin, moduleDev: ModuleDev) {
|
|
super(leaf);
|
|
this.plugin = plugin;
|
|
this.moduleDev = moduleDev;
|
|
}
|
|
|
|
getViewType() {
|
|
return VIEW_TYPE_TEST;
|
|
}
|
|
|
|
getDisplayText() {
|
|
return "Self-hosted LiveSync Test and Results";
|
|
}
|
|
|
|
async onOpen() {
|
|
this.component = new TestPaneComponent({
|
|
target: this.contentEl,
|
|
props: {
|
|
plugin: this.plugin,
|
|
moduleDev: this.moduleDev,
|
|
},
|
|
});
|
|
await Promise.resolve();
|
|
}
|
|
|
|
async onClose() {
|
|
this.component?.$destroy();
|
|
await Promise.resolve();
|
|
}
|
|
}
|