Add prompt to confirm new project

This commit is contained in:
Steve Ruiz 2021-11-18 11:23:19 +00:00
parent d1b37b7997
commit 3228ff6352

View file

@ -18,8 +18,10 @@ export function useFileSystem() {
const onNewProject = React.useCallback( const onNewProject = React.useCallback(
async (app: TldrawApp) => { async (app: TldrawApp) => {
await promptSaveBeforeChange(app) if (window.confirm('Do you want to create a new project?')) {
app.newProject() await promptSaveBeforeChange(app)
app.newProject()
}
}, },
[promptSaveBeforeChange] [promptSaveBeforeChange]
) )