From 21b1201a046b674bdef806469df06bebe0ad3c07 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 16 Nov 2022 03:17:00 -0500 Subject: [PATCH] Defaults sidebar toggle to SCM --- src/webviews/home/homeWebviewView.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/webviews/home/homeWebviewView.ts b/src/webviews/home/homeWebviewView.ts index 4bdc1b9..13cfdee 100644 --- a/src/webviews/home/homeWebviewView.ts +++ b/src/webviews/home/homeWebviewView.ts @@ -67,9 +67,7 @@ export class HomeWebviewView extends WebviewViewBase { } private onStorageChanged(e: StorageChangeEvent) { - if (e.key !== 'views:layout') { - return; - } + if (e.key !== 'views:layout') return; this.notifyDidChangeLayout(); } @@ -270,18 +268,13 @@ export class HomeWebviewView extends WebviewViewBase { private getLayout() { const layout = this.container.storage.get('views:layout'); - if (layout == null) { - return ViewsLayout.GitLens; - } - return layout as ViewsLayout; + return layout != null ? (layout as ViewsLayout) : ViewsLayout.SourceControl; } private notifyDidChangeLayout() { if (!this.isReady) return; - void this.notify(DidChangeLayoutType, { - layout: this.getLayout(), - }); + void this.notify(DidChangeLayoutType, { layout: this.getLayout() }); } private _validateSubscriptionDebounced: Deferrable | undefined = undefined;