mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-30 06:04:37 +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 {
|
export class WebConfigProvider extends ConfigProvider {
|
||||||
defaults = {
|
defaults = {
|
||||||
web: {
|
web: {
|
||||||
preventAccidentalTabClosure: true,
|
preventAccidentalTabClosure: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -12,12 +12,15 @@ export class WebHostWindow extends HostWindowService {
|
|||||||
this.windowShown.next()
|
this.windowShown.next()
|
||||||
this.windowFocused.next()
|
this.windowFocused.next()
|
||||||
|
|
||||||
window.addEventListener('beforeunload', (event) => {
|
const unloadHandler = (event) => {
|
||||||
if (config.store.web.preventAccidentalTabClosure) {
|
if (config.store.web.preventAccidentalTabClosure) {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.returnValue = 'Are you sure you want to close Tabby? You can disable this prompt in Settings -> Window.'
|
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 {
|
reload (): void {
|
||||||
|
Reference in New Issue
Block a user