mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2025-12-24 07:01:29 +00:00
### Fixed
- Conflict resolving dialogue now properly displays the changeset name instead of A or B (#691).
This commit is contained in:
@@ -25,8 +25,8 @@ export class ConflictResolveModal extends Modal {
|
|||||||
title: string = "Conflicting changes";
|
title: string = "Conflicting changes";
|
||||||
|
|
||||||
pluginPickMode: boolean = false;
|
pluginPickMode: boolean = false;
|
||||||
localName: string = "Use Base";
|
localName: string = "Base";
|
||||||
remoteName: string = "Use Conflicted";
|
remoteName: string = "Conflicted";
|
||||||
offEvent?: ReturnType<typeof eventHub.onEvent>;
|
offEvent?: ReturnType<typeof eventHub.onEvent>;
|
||||||
|
|
||||||
constructor(app: App, filename: string, diff: diff_result, pluginPickMode?: boolean, remoteName?: string) {
|
constructor(app: App, filename: string, diff: diff_result, pluginPickMode?: boolean, remoteName?: string) {
|
||||||
@@ -36,8 +36,8 @@ export class ConflictResolveModal extends Modal {
|
|||||||
this.pluginPickMode = pluginPickMode || false;
|
this.pluginPickMode = pluginPickMode || false;
|
||||||
if (this.pluginPickMode) {
|
if (this.pluginPickMode) {
|
||||||
this.title = "Pick a version";
|
this.title = "Pick a version";
|
||||||
this.remoteName = `Use ${remoteName || "Remote"}`;
|
this.remoteName = `${remoteName || "Remote"}`;
|
||||||
this.localName = "Use Local";
|
this.localName = "Local";
|
||||||
}
|
}
|
||||||
// Send cancel signal for the previous merge dialogue
|
// Send cancel signal for the previous merge dialogue
|
||||||
// if not there, simply be ignored.
|
// if not there, simply be ignored.
|
||||||
@@ -93,12 +93,13 @@ export class ConflictResolveModal extends Modal {
|
|||||||
const date2 =
|
const date2 =
|
||||||
new Date(this.result.right.mtime).toLocaleString() + (this.result.right.deleted ? " (Deleted)" : "");
|
new Date(this.result.right.mtime).toLocaleString() + (this.result.right.deleted ? " (Deleted)" : "");
|
||||||
div2.innerHTML = `
|
div2.innerHTML = `
|
||||||
<span class='deleted'>A:${date1}</span><br /><span class='added'>B:${date2}</span><br>
|
<span class='deleted'><span class='conflict-dev-name'>${this.localName}</span>: ${date1}</span><br>
|
||||||
|
<span class='added'><span class='conflict-dev-name'>${this.remoteName}</span>: ${date2}</span><br>
|
||||||
`;
|
`;
|
||||||
contentEl.createEl("button", { text: this.localName }, (e) =>
|
contentEl.createEl("button", { text: `Use ${this.localName}` }, (e) =>
|
||||||
e.addEventListener("click", () => this.sendResponse(this.result.right.rev))
|
e.addEventListener("click", () => this.sendResponse(this.result.right.rev))
|
||||||
).style.marginRight = "4px";
|
).style.marginRight = "4px";
|
||||||
contentEl.createEl("button", { text: this.remoteName }, (e) =>
|
contentEl.createEl("button", { text: `Use ${this.remoteName}` }, (e) =>
|
||||||
e.addEventListener("click", () => this.sendResponse(this.result.left.rev))
|
e.addEventListener("click", () => this.sendResponse(this.result.left.rev))
|
||||||
).style.marginRight = "4px";
|
).style.marginRight = "4px";
|
||||||
if (!this.pluginPickMode) {
|
if (!this.pluginPickMode) {
|
||||||
|
|||||||
@@ -12,6 +12,11 @@
|
|||||||
background-color: var(--text-muted);
|
background-color: var(--text-muted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.conflict-dev-name {
|
||||||
|
display: inline-block;
|
||||||
|
min-width: 5em;
|
||||||
|
}
|
||||||
|
|
||||||
.op-scrollable {
|
.op-scrollable {
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
/* min-height: 280px; */
|
/* min-height: 280px; */
|
||||||
|
|||||||
Reference in New Issue
Block a user