Change the extension to .excalidraw (#858)

* Change the extension to .excalidra

* Support opening as well

* support .excalidraw extension on canvas  DranAndDrop

Co-authored-by: Faustino Kialungila <Faustino.kialungila@gmail.com>
This commit is contained in:
Lipis 2020-02-29 18:42:26 +01:00 committed by GitHub
parent 5fff1f2d3e
commit 0ee33fe341
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -2191,7 +2191,10 @@ export class App extends React.Component<any, AppState> {
onPointerLeave={this.removePointer}
onDrop={event => {
const file = event.dataTransfer.files[0];
if (file?.type === "application/json") {
if (
file?.type === "application/json" ||
file?.name.endsWith(".excalidraw")
) {
loadFromBlob(file)
.then(({ elements, appState }) =>
this.syncActionResult({ elements, appState }),