## 0.24.14

### 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.
This commit is contained in:
vorotamoroz
2025-02-18 12:59:18 +00:00
parent f6d5b78cc8
commit 70f4e23474
13 changed files with 3272 additions and 2186 deletions

View File

@@ -2,13 +2,14 @@ import { App, Modal } from "../../deps.ts";
import { type FilePath, type LoadedEntry } from "../../lib/src/common/types.ts";
import JsonResolvePane from "./JsonResolvePane.svelte";
import { waitForSignal } from "../../lib/src/common/utils.ts";
import { mount, unmount } from "svelte";
export class JsonResolveModal extends Modal {
// result: Array<[number, string]>;
filename: FilePath;
callback?: (keepRev?: string, mergedStr?: string) => Promise<void>;
docs: LoadedEntry[];
component?: JsonResolvePane;
component?: ReturnType<typeof mount>;
nameA: string;
nameB: string;
defaultSelect: string;
@@ -55,7 +56,7 @@ export class JsonResolveModal extends Modal {
contentEl.empty();
if (this.component == undefined) {
this.component = new JsonResolvePane({
this.component = mount(JsonResolvePane, {
target: contentEl,
props: {
docs: this.docs,
@@ -81,7 +82,7 @@ export class JsonResolveModal extends Modal {
void this.callback(undefined);
}
if (this.component != undefined) {
this.component.$destroy();
void unmount(this.component);
this.component = undefined;
}
}