Fix conditional for overrideCommandForWebview

This command should be active if:

- we are on mac
- or we are not using custom title bars

The previous code was incorrectly disabling these commands entirely on mac
This commit is contained in:
Matt Bierner
2020-07-13 10:56:21 -07:00
parent 1cfd3a1b28
commit 2b5ac23284
@@ -47,15 +47,14 @@ const PRIORITY = 100;
function overrideCommandForWebview(command: MultiCommand | undefined, f: (webview: ElectronWebviewBasedWebview) => void) {
command?.addImplementation(PRIORITY, accessor => {
if (!isMacintosh || accessor.get(IConfigurationService).getValue<string>('window.titleBarStyle') !== 'native') {
return false;
if (isMacintosh || accessor.get(IConfigurationService).getValue<string>('window.titleBarStyle') === 'native') {
const webview = getActiveElectronBasedWebview(accessor);
if (webview) {
f(webview);
return true;
}
}
const webview = getActiveElectronBasedWebview(accessor);
if (webview) {
f(webview);
return true;
}
return false;
});
}