瀏覽代碼

Un-nests ifs

main
Eric Amodio 1 年之前
父節點
當前提交
044887bf00
共有 2 個文件被更改,包括 7 次插入11 次删除
  1. +5
    -7
      src/plus/webviews/graph/graphWebview.ts
  2. +2
    -4
      src/plus/webviews/timeline/timelineWebview.ts

+ 5
- 7
src/plus/webviews/graph/graphWebview.ts 查看文件

@ -753,13 +753,11 @@ export class GraphWebviewProvider implements WebviewProvider {
}
private onThemeChanged(theme: ColorTheme) {
if (this._theme != null) {
if (
(isDarkTheme(theme) && isDarkTheme(this._theme)) ||
(isLightTheme(theme) && isLightTheme(this._theme))
) {
return;
}
if (
this._theme != null &&
((isDarkTheme(theme) && isDarkTheme(this._theme)) || (isLightTheme(theme) && isLightTheme(this._theme)))
) {
return;
}
this._theme = theme;

+ 2
- 4
src/plus/webviews/timeline/timelineWebview.ts 查看文件

@ -223,10 +223,8 @@ export class TimelineWebviewProvider implements WebviewProvider {
if (e.data == null) return;
let uri: Uri | undefined = e.data.uri;
if (uri != null) {
if (!this.container.git.isTrackable(uri)) {
uri = undefined;
}
if (uri != null && !this.container.git.isTrackable(uri)) {
uri = undefined;
}
if (!this.updatePendingUri(uri)) return;

Loading…
取消
儲存