Add prompt to confirm new project
This commit is contained in:
parent
d1b37b7997
commit
3228ff6352
1 changed files with 4 additions and 2 deletions
|
@ -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]
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue