Added right share url link

This commit is contained in:
chris
2022-06-17 23:55:07 +08:00
parent 22f12063e4
commit 0752c5bbd9

View File

@@ -92,10 +92,8 @@ export class Upload2Notion {
if(notionID){ if(notionID){
res = await this.updatePage(notionID, title, file2Block); res = await this.updatePage(notionID, title, file2Block);
console.log(res)
} else { } else {
res = await this.createPage(title, file2Block); res = await this.createPage(title, file2Block);
console.log(res)
} }
if (res.status === 200) { if (res.status === 200) {
await this.updateYamlInfo(markdown, nowFile, res, app, settings) await this.updateYamlInfo(markdown, nowFile, res, app, settings)
@@ -109,14 +107,12 @@ export class Upload2Notion {
const yamlObj:any = yamlFrontMatter.loadFront(yamlContent); const yamlObj:any = yamlFrontMatter.loadFront(yamlContent);
let {url, id} = res.json let {url, id} = res.json
// replace www to notionID // replace www to notionID
console.log(app)
const {notionID} = settings; const {notionID} = settings;
if(notionID!=="") { if(notionID!=="") {
// replace url str "www" to notionID // replace url str "www" to notionID
url = url.replace("www.notion.so", `${notionID}.notion.site`) url = url.replace("www.notion.so", `${notionID}.notion.site`)
} }
yamlObj.link = url; yamlObj.link = url;
console.log(url)
try { try {
await navigator.clipboard.writeText(url) await navigator.clipboard.writeText(url)
} catch (error) { } catch (error) {