add button to copy url

This commit is contained in:
fyears 2022-01-05 00:58:59 +08:00
parent 313eff6a14
commit 84b03d2c2b

View File

@ -170,6 +170,21 @@ export class OnedriveAuthModal extends Modal {
contentEl.createEl("p", {
text: "Finally you should be redirected to Obsidian.",
});
const div2 = contentEl.createDiv();
div2.createEl(
"button",
{
text: "Click to copy the auth url",
},
(el) => {
el.onclick = async () => {
await navigator.clipboard.writeText(authUrl);
new Notice("the auth url copied to clipboard!");
};
}
);
contentEl.createEl("p").createEl("a", {
href: authUrl,
text: authUrl,