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(
async (app: TldrawApp) => {
await promptSaveBeforeChange(app)
app.newProject()
if (window.confirm('Do you want to create a new project?')) {
await promptSaveBeforeChange(app)
app.newProject()
}
},
[promptSaveBeforeChange]
)