From ece2cc15ee80a8ca2f743e0b7b0ddc6a47ce4ab7 Mon Sep 17 00:00:00 2001 From: Amphiluke Date: Fri, 22 Dec 2023 21:36:44 +0700 Subject: [PATCH] Minor update in README --- README.md | 16 +++++++++------- package.json | 2 +- plugin.xml | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c8c3f8f..1d181ee 100644 --- a/README.md +++ b/README.md @@ -31,9 +31,9 @@ To construct a Blob representation for a file contents, either use the [`Blob` c let blob = new Blob(["file contents"], {type: "text/plain"}); let fileName = "my-file.txt"; cordova.plugins.saveDialog.saveFile(blob, fileName).then(uri => { - console.info("The file has been successfully saved to", uri); + console.info("The file has been successfully saved to", uri); }).catch(reason => { - console.warn(reason); + console.warn(reason); }); ``` @@ -41,12 +41,14 @@ or apply other methods of blob generation (such as [`Response.blob()`](https://d ```javascript try { - let response = await fetch(`https://avatars.dicebear.com/api/avataaars/${Math.random()}.svg`); - let blob = await response.blob(); - let uri = await cordova.plugins.saveDialog.saveFile(blob, "random-avatar.svg"); - console.info("The file has been successfully saved to", uri); + let response = await fetch("https://httpbin.org/image/jpeg", { + headers: {Accept: "image/jpeg"} + }); + let blob = await response.blob(); + let uri = await cordova.plugins.saveDialog.saveFile(blob, "jackal.jpeg"); + console.info("The file has been successfully saved to", uri); } catch (e) { - console.error(e); + console.error(e); } ``` diff --git a/package.json b/package.json index 314f544..05d3d73 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-save-dialog", - "version": "2.0.0", + "version": "2.0.1", "description": "Cordova plugin for opening the native Save dialog and storing a file in the user-selected location", "main": "index.js", "scripts": { diff --git a/plugin.xml b/plugin.xml index 59fa894..7dd1df1 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,5 +1,5 @@ - + Save Dialog Cordova plugin for opening the native Save dialog and storing a file in the user-selected location MIT