Update index.html
This commit is contained in:
parent
1d64430cc8
commit
5b2404da3a
1 changed files with 2 additions and 1 deletions
|
@ -342,11 +342,12 @@
|
||||||
|
|
||||||
async function saveAs(content) {
|
async function saveAs(content) {
|
||||||
const blob = new Blob([content], { type: "text/plain" });
|
const blob = new Blob([content], { type: "text/plain" });
|
||||||
|
const extension = currentFile.split(".").pop().toLowerCase();
|
||||||
const fileHandle = await window.showSaveFilePicker({
|
const fileHandle = await window.showSaveFilePicker({
|
||||||
types: [
|
types: [
|
||||||
{
|
{
|
||||||
description: "Source code",
|
description: "Source code",
|
||||||
accept: { "text/plain": [".txt"] },
|
accept: { "text/plain": [`.${extension || "txt"}`] },
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue