Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
AllegroFox committed Aug 22, 2024
1 parent a5c333b commit 453f354
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Wizard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,23 +169,23 @@ export default function Wizard({
}
};

const encodePreview = (jsonStr): string => {
const encodePreview = (jsonStr: string): string => {
const codeUnits = new Uint16Array(jsonStr.length);
for (let i = 0; i < codeUnits.length; i++) {
codeUnits[i] = jsonStr.charCodeAt(i);
}
return btoa(
String.fromCharCode(...Array.from(new Uint8Array(codeUnits.buffer))),
String.fromCharCode(...Array.from(new Uint8Array(codeUnits.buffer)))
);
}
};

const handlePreview = async (): Promise<void> => {
try {
const json = await validate();
if (json) {
const jsonStr = JSON.stringify(json);
const uri = `about:messagepreview?json=${encodeURIComponent(
encodePreview(jsonStr),
encodePreview(jsonStr)
)}`;
addToast("Success", "Copied!", { autohide: true });

Expand Down

0 comments on commit 453f354

Please sign in to comment.