mirror of
https://github.com/Eugeny/tabby.git
synced 2024-11-26 13:10:36 +03:00
disable preventAccidentalTabClosure by default
This commit is contained in:
parent
2fc457dd78
commit
e3214e38d3
@ -4,7 +4,7 @@ import { ConfigProvider } from 'tabby-core'
|
||||
export class WebConfigProvider extends ConfigProvider {
|
||||
defaults = {
|
||||
web: {
|
||||
preventAccidentalTabClosure: true,
|
||||
preventAccidentalTabClosure: false,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -12,12 +12,15 @@ export class WebHostWindow extends HostWindowService {
|
||||
this.windowShown.next()
|
||||
this.windowFocused.next()
|
||||
|
||||
window.addEventListener('beforeunload', (event) => {
|
||||
const unloadHandler = (event) => {
|
||||
if (config.store.web.preventAccidentalTabClosure) {
|
||||
event.preventDefault()
|
||||
event.returnValue = 'Are you sure you want to close Tabby? You can disable this prompt in Settings -> Window.'
|
||||
} else {
|
||||
window.removeEventListener('beforeunload', unloadHandler)
|
||||
}
|
||||
})
|
||||
}
|
||||
window.addEventListener('beforeunload', unloadHandler)
|
||||
}
|
||||
|
||||
reload (): void {
|
||||
|
Loading…
Reference in New Issue
Block a user