Update index.html

This commit is contained in:
The Ghost of FOSS' Future 2024-09-17 18:41:37 -05:00 committed by GitHub
parent 1d64430cc8
commit 5b2404da3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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"}`] },
}, },
], ],
}); });