Skip to content

Commit

Permalink
fix: await can't be used in a non-async function
Browse files Browse the repository at this point in the history
  • Loading branch information
Mara-Li authored Jun 8, 2023
1 parent de9b5e9 commit 68dbc85
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/commands/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ export async function purgeNotesRemoteCallback(plugin: GithubPublisher, repo: Re
id: id,
name: name,
hotkeys: [],
checkCallback: (checking) => {
//@ts-ignore
checkCallback: async (checking) => {
if (plugin.settings.upload.autoclean.enable && plugin.settings.upload.behavior !== FolderSettings.fixed) {
if (!checking) {
//@ts-ignore
Expand Down Expand Up @@ -110,7 +111,8 @@ export async function shareOneNoteCallback(repo: Repository|null, plugin: Github
id: id,
name: name,
hotkeys: [],
checkCallback: (checking) => {
//@ts-ignore
checkCallback: async (checking) => {
const file = plugin.app.workspace.getActiveFile();
const frontmatter = file ? plugin.app.metadataCache.getFileCache(file).frontmatter : null;
if (
Expand Down Expand Up @@ -231,13 +233,13 @@ export async function checkRepositoryValidityCallback(plugin: GithubPublisher, r
return {
id: id,
name: name,
checkCallback: (checking) => {
//@ts-ignore
checkCallback: async (checking) => {
if (plugin.app.workspace.getActiveFile())
{
if (!checking) {
checkRepositoryValidity(
branchName,
//@ts-ignore
await plugin.reloadOctokit(),
plugin.settings,
repo,
Expand Down

0 comments on commit 68dbc85

Please sign in to comment.