Skip to content

Commit

Permalink
fix: sync usage of fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
islxyqwe committed Jul 12, 2024
1 parent 8272c42 commit 3b0cf3c
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/sync.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { App, TFile, normalizePath } from "obsidian";
import { App, TFile, normalizePath, requestUrl } from "obsidian";
import {
downloadAssets,
getNotebookDownloadURL,
Expand Down Expand Up @@ -149,18 +149,16 @@ export async function listenSync(
}
if (!item.template) {
try {
const resp = await fetch(
getNotebookDownloadURL(
const resp = await requestUrl({
url: getNotebookDownloadURL(
item.notebook_id,
data.note_id
),
{
headers: {
"access-key": accessKey,
},
}
);
item.template = await resp.text();
headers: {
"access-key": accessKey,
},
});
item.template = resp.text;
} catch (e) {
console.error(e);
}
Expand Down

0 comments on commit 3b0cf3c

Please sign in to comment.