Skip to content

Commit

Permalink
Force a generic description if none given.
Browse files Browse the repository at this point in the history
Fixes #118
  • Loading branch information
tomayac committed Jun 29, 2022
1 parent 6f8e260 commit f822328
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 2 additions & 0 deletions demo/script.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import { imageToBlob } from './image-to-blob.mjs';
openButton.addEventListener('click', async () => {
try {
const blob = await fileOpen({
description: 'Image files',
mimeTypes: ['image/jpg', 'image/png', 'image/gif', 'image/webp'],
extensions: ['.jpg', '.jpeg', '.png', '.gif', '.webp'],
});
Expand All @@ -82,6 +83,7 @@ import { imageToBlob } from './image-to-blob.mjs';
openMultipleButton.addEventListener('click', async () => {
try {
const blobs = await fileOpen({
description: 'Image files',
mimeTypes: ['image/jpg', 'image/png', 'image/gif', 'image/webp'],
extensions: ['.jpg', '.jpeg', '.png', '.gif', '.webp'],
multiple: true,
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "browser-fs-access",
"version": "0.30.1",
"version": "0.30.2",
"description": "File System Access API with legacy fallback in the browser.",
"type": "module",
"source": "./src/index.js",
Expand Down
2 changes: 1 addition & 1 deletion src/fs-access/file-open.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default async (options = [{}]) => {
const types = [];
options.forEach((option, i) => {
types[i] = {
description: option.description || '',
description: option.description || 'Files',
accept: {},
};
if (option.mimeTypes) {
Expand Down
2 changes: 1 addition & 1 deletion src/fs-access/file-save.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default async (
}
options.forEach((option, i) => {
types[i] = {
description: option.description || '',
description: option.description || 'Files',
accept: {},
};
if (option.mimeTypes) {
Expand Down

0 comments on commit f822328

Please sign in to comment.