fix: Update browser-fs-access to use new supported export (#3303)

* Use new exported supported

* Bump to v0.15.3
This commit is contained in:
Thomas Steiner 2021-03-22 14:58:26 +01:00 committed by GitHub
parent 78f3a92dd1
commit f7e17a28fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9988 additions and 9344 deletions

View File

@ -27,7 +27,7 @@
"@types/react": "17.0.2", "@types/react": "17.0.2",
"@types/react-dom": "17.0.1", "@types/react-dom": "17.0.1",
"@types/socket.io-client": "1.4.36", "@types/socket.io-client": "1.4.36",
"browser-fs-access": "0.14.2", "browser-fs-access": "0.15.3",
"clsx": "1.1.1", "clsx": "1.1.1",
"firebase": "8.2.10", "firebase": "8.2.10",
"i18next-browser-languagedetector": "6.0.1", "i18next-browser-languagedetector": "6.0.1",

View File

@ -11,6 +11,7 @@ import { t } from "../i18n";
import useIsMobile from "../is-mobile"; import useIsMobile from "../is-mobile";
import { KEYS } from "../keys"; import { KEYS } from "../keys";
import { register } from "./register"; import { register } from "./register";
import { supported } from "browser-fs-access";
export const actionChangeProjectName = register({ export const actionChangeProjectName = register({
name: "changeProjectName", name: "changeProjectName",
@ -164,9 +165,7 @@ export const actionSaveAsScene = register({
title={t("buttons.saveAs")} title={t("buttons.saveAs")}
aria-label={t("buttons.saveAs")} aria-label={t("buttons.saveAs")}
showAriaLabel={useIsMobile()} showAriaLabel={useIsMobile()}
hidden={ hidden={!supported}
!("chooseFileSystemEntries" in window || "showOpenFilePicker" in window)
}
onClick={() => updateData(null)} onClick={() => updateData(null)}
/> />
), ),

View File

@ -3,6 +3,7 @@ import React from "react";
import { RoughCanvas } from "roughjs/bin/canvas"; import { RoughCanvas } from "roughjs/bin/canvas";
import rough from "roughjs/bin/rough"; import rough from "roughjs/bin/rough";
import clsx from "clsx"; import clsx from "clsx";
import { supported } from "browser-fs-access";
import { import {
actionAddToLibrary, actionAddToLibrary,
@ -3609,10 +3610,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
file?.name.endsWith(".excalidraw") file?.name.endsWith(".excalidraw")
) { ) {
this.setState({ isLoading: true }); this.setState({ isLoading: true });
if ( if (supported) {
"chooseFileSystemEntries" in window ||
"showOpenFilePicker" in window
) {
try { try {
// This will only work as of Chrome 86, // This will only work as of Chrome 86,
// but can be safely ignored on older releases. // but can be safely ignored on older releases.

19319
yarn.lock

File diff suppressed because it is too large Load Diff