Skip to content

Commit

Permalink
fix(webdav): can't backup config
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed May 6, 2024
1 parent aa194cb commit cd6505d
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions src/background/plugins/WebDAV.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,18 +101,22 @@ export class WebDAV {
*/
public add(formData: FormData): Promise<any> {
return new Promise<any>((resolve?: any, reject?: any) => {
this.service
.putFileContents(formData.get("name"), formData.get("data"))
.then((result: any) => {
if (result) {
resolve(true);
} else {
reject(false);
}
(formData.get("data") as Blob).arrayBuffer().then(data => {
this.service
.putFileContents(formData.get("name"), data)
.then((result: any) => {
console.log(result)
if (result) {
resolve(true);
} else {
reject(false);
}
})
.catch((error: any) => {
console.log(error)
reject(error);
});
})
.catch((error: any) => {
reject(error);
});
});
}

Expand Down

0 comments on commit cd6505d

Please sign in to comment.