mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-07-28 15:32:59 +00:00
Refine P2P and manual setup workflows
This commit is contained in:
@@ -128,12 +128,18 @@ export class ObsidianConfirm<T extends ObsidianServiceContext = ObsidianServiceC
|
||||
opt: { title?: string; defaultAction: T[number]; timeout?: number }
|
||||
): Promise<T[number] | false> {
|
||||
const defaultTitle = $msg("moduleInputUIObsidian.defaultTitleSelect");
|
||||
// Commonlib owns the transport decision, while LiveSync owns the
|
||||
// concrete Obsidian view which lets users revise that decision.
|
||||
const presentedMessage =
|
||||
opt.title === "P2P Connection Request"
|
||||
? message.replace("Peer-to-Peer Replicator Pane", $msg("P2P Status pane"))
|
||||
: message;
|
||||
if (!this.hasCountdown(opt.timeout)) {
|
||||
const result = await confirmAction(
|
||||
this._app,
|
||||
{
|
||||
title: opt.title || defaultTitle,
|
||||
message,
|
||||
message: presentedMessage,
|
||||
actions: buttons,
|
||||
actionLayout: "vertical",
|
||||
defaultAction: opt.defaultAction,
|
||||
@@ -146,7 +152,7 @@ export class ObsidianConfirm<T extends ObsidianServiceContext = ObsidianServiceC
|
||||
return confirmWithMessageWithWideButton(
|
||||
this._plugin,
|
||||
opt.title || defaultTitle,
|
||||
message,
|
||||
presentedMessage,
|
||||
buttons,
|
||||
opt.defaultAction,
|
||||
opt.timeout
|
||||
|
||||
Reference in New Issue
Block a user