Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jecsham committed Jun 5, 2022
1 parent 5db7667 commit d45f82f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
10 changes: 8 additions & 2 deletions src/components/OptionsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,18 @@ msi.jecsham.com`);
<div uk-dropdown="mode: click">
<ul className="uk-nav uk-dropdown-nav">
<li>
<button onClick={saveImage} className="uk-button uk-button-small uk-button-link">
<button
onClick={saveImage}
className="uk-button uk-button-small uk-button-link"
>
Save as .png image
</button>
</li>
<li>
<button onClick={saveText} className="uk-button uk-button-small uk-button-link">
<button
onClick={saveText}
className="uk-button uk-button-small uk-button-link"
>
Save as .txt file
</button>
</li>
Expand Down
2 changes: 1 addition & 1 deletion src/libs/html2canvas.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import html2canvas from "html2canvas";
import { dialog, fs } from "@tauri-apps/api";
var Buffer = require('buffer/').Buffer
var Buffer = require("buffer/").Buffer;

const _decodeBase64Image = (dataString: string) => {
let matches = dataString.match(/^data:([A-Za-z-+\/]+);base64,(.+)$/);
Expand Down
6 changes: 3 additions & 3 deletions src/libs/txt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ const saveAsTxt = async () => {
let tableData = await _getSystemDataFromForage();
if (!tableData) return;

tableData.forEach((e:any) => {
tableData.forEach((e: any) => {
text += e.title + "\n";
e.content.forEach((c:any) => {
e.content.forEach((c: any) => {
text += c + "\n";
});
text += "\n";
Expand All @@ -33,7 +33,7 @@ const saveAsTxt = async () => {
],
});
if (!saveDir) throw "Unable to get path";
fs.writeFile({path: saveDir, contents: text});
fs.writeFile({ path: saveDir, contents: text });
} catch (error) {
console.log(error);
}
Expand Down

0 comments on commit d45f82f

Please sign in to comment.