Skip to content

Commit 4cbade5

Browse files
committed
feat: update writeFile api use
1 parent 63dccd1 commit 4cbade5

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

src/mdFsProvider.ts

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,25 +88,9 @@ export class HackMDFsProvider implements vscode.FileSystemProvider {
8888
throw vscode.FileSystemError.FileNotFound();
8989
}
9090

91-
let teamPath;
92-
93-
try {
94-
const note = await API.getNote(noteId);
95-
96-
teamPath = note.teamPath;
97-
} catch (e) {
98-
console.error(e);
99-
throw vscode.FileSystemError.FileNotFound();
100-
}
101-
102-
const contentString = Buffer.from(content).toString();
103-
10491
try {
105-
if (teamPath) {
106-
await API.updateTeamNoteContent(teamPath, noteId, contentString);
107-
} else {
108-
await API.updateNoteContent(noteId, contentString);
109-
}
92+
const contentString = Buffer.from(content).toString();
93+
await API.updateNoteContent(noteId, contentString);
11094
} catch (e) {
11195
console.error(e);
11296
throw vscode.FileSystemError.Unavailable();

0 commit comments

Comments
 (0)