Skip to content

Commit

Permalink
fix: the callback function should not appear if share: false
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li committed Dec 28, 2023
1 parent 67c8a66 commit b2a9efd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/commands/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,13 @@ export async function shareOneNoteCallback(repo: Repository|null, plugin: Github
let name = i18next.t("commands.shareActiveFile");
const common = i18next.t("common.repository");
name = repo ? `${name} (${common} : ${repo.smartKey})` : name;
const octokit = await plugin.reloadOctokit();
//@ts-ignore
return {
id,
name,
hotkeys: [],
//@ts-ignore
checkCallback: async (checking) => {
checkCallback: (checking) => {
const file = plugin.app.workspace.getActiveFile();
const frontmatter = file ? plugin.app.metadataCache.getFileCache(file)?.frontmatter : null;
if (
Expand All @@ -121,8 +121,7 @@ export async function shareOneNoteCallback(repo: Repository|null, plugin: Github
if (!checking) {
shareOneNote(
branchName,
//@ts-ignore
await plugin.reloadOctokit(),
octokit,
file,
repo,
file.basename,
Expand Down

0 comments on commit b2a9efd

Please sign in to comment.