Skip to content

Commit

Permalink
Merge pull request #933 from vorth/classic-dropbox
Browse files Browse the repository at this point in the history
adding Dropbox support to classic online
  • Loading branch information
vorth authored Dec 9, 2024
2 parents a9f8b7a + 0c88930 commit f130e46
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions online/src/app/classic/menus/filemenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,18 @@ export const FileMenu = () =>
}
}

const dropboxEnabled = window.Dropbox && window.localStorage.getItem( 'vzome.enable.dropbox' ) === 'true';

const showDropboxChooser = () => {
window.Dropbox.choose( {
linkType: 'direct',
extensions: ['.vzome'],
success: (files) => {
fetchDesignUrl( files[0].link, { preview: false, debug: false } );
},
} );
}

// Open the design indicated in the query string, if any
onMount( () => url && openUrl( url ) );

Expand Down Expand Up @@ -146,6 +158,8 @@ export const FileMenu = () =>

<MenuAction label="Open..." onClick={() => guard(handleOpen)} />
<MenuAction label="Open URL..." onClick={() => guard(handleShowUrlDialog)} />
{ dropboxEnabled &&
<MenuAction label="Choose from Dropbox..." onClick={() => guard(showDropboxChooser)} /> }
<MenuItem disabled={true}>Open As New Model...</MenuItem>

<Divider/>
Expand Down

0 comments on commit f130e46

Please sign in to comment.