From 0c88930c63cb2016cd4bb882cf01b385c0053a0d Mon Sep 17 00:00:00 2001 From: Scott Vorthmann Date: Sun, 8 Dec 2024 19:36:55 -0800 Subject: [PATCH] Added Dropbox support to classic online --- online/src/app/classic/menus/filemenu.jsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/online/src/app/classic/menus/filemenu.jsx b/online/src/app/classic/menus/filemenu.jsx index ef7f83f74..8d41d119a 100644 --- a/online/src/app/classic/menus/filemenu.jsx +++ b/online/src/app/classic/menus/filemenu.jsx @@ -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 ) ); @@ -146,6 +158,8 @@ export const FileMenu = () => guard(handleOpen)} /> guard(handleShowUrlDialog)} /> + { dropboxEnabled && + guard(showDropboxChooser)} /> } Open As New Model...