mirror of
https://github.com/jxpeng98/obsidian-to-NotionNext
synced 2026-07-31 01:48:35 +08:00
update notice
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { App, Notice, TFile } from "obsidian";
|
||||
import ObsidianSyncNotionPlugin from "../main";
|
||||
import { DatabaseDetails } from "../ui/settingTabs";
|
||||
import { i18nConfig } from "src/lang/I18n";
|
||||
|
||||
export async function updateYamlInfo(
|
||||
yamlContent: string,
|
||||
@@ -37,6 +38,7 @@ export async function updateYamlInfo(
|
||||
try {
|
||||
await navigator.clipboard.writeText(url)
|
||||
} catch (error) {
|
||||
new Notice(`复制链接失败,请手动复制${error}`)
|
||||
console.log(error)
|
||||
new Notice(`${i18nConfig.CopyErrorMessage}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,9 +54,9 @@ export async function uploadCommandNext(
|
||||
const res = await upload.syncMarkdownToNotionNext(basename, emoji, cover, tags, type, slug, stats, category, summary, paword, favicon, datetime, markDownData, nowFile, this.app);
|
||||
|
||||
if (res.status === 200) {
|
||||
new Notice(`${i18nConfig["sync-success"]}${basename}`);
|
||||
new Notice(`${i18nConfig["sync-preffix"]} ${basename} ${i18nConfig["sync-success"]}`).noticeEl.style.color = "green";
|
||||
} else {
|
||||
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
|
||||
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000).noticeEl.style.color = "red";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -88,7 +88,7 @@ export async function uploadCommandGeneral(
|
||||
const res = await upload.syncMarkdownToNotionGeneral(basename, cover, tags, markDownData, nowFile, this.app);
|
||||
|
||||
if (res.status === 200) {
|
||||
new Notice(`${i18nConfig["sync-success"]}${basename}`);
|
||||
new Notice(`${i18nConfig["sync-success"]}${basename}`).noticeEl.style.color = "green";
|
||||
} else {
|
||||
new Notice(`${i18nConfig["sync-fail"]}${basename}`, 5000);
|
||||
}
|
||||
|
||||
@@ -99,6 +99,7 @@ export class Upload2NotionCustom extends UploadBaseCustom {
|
||||
app: App,
|
||||
): Promise<any> {
|
||||
const options = {
|
||||
strictImageUrls: true,
|
||||
notionLimits: {
|
||||
truncate: false,
|
||||
}
|
||||
@@ -123,7 +124,7 @@ export class Upload2NotionCustom extends UploadBaseCustom {
|
||||
} else {
|
||||
res = await this.createPage(cover, customValues, file2Block);
|
||||
}
|
||||
if (res.status === 200) {
|
||||
if (res && res.status === 200) {
|
||||
await updateYamlInfo(markdown, nowFile, res, app, this.plugin, this.dbDetails);
|
||||
} else {
|
||||
new Notice(`${res.text}`);
|
||||
@@ -228,7 +229,7 @@ export class Upload2NotionCustom extends UploadBaseCustom {
|
||||
}
|
||||
);
|
||||
|
||||
console.log(properties)
|
||||
// console.log(properties)
|
||||
|
||||
return {
|
||||
parent: {
|
||||
|
||||
Reference in New Issue
Block a user