mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-23 03:48:01 +00:00
disable preventAccidentalTabClosure by default
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user