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(
|
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]
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue