• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gitify-app / gitify / 12586431667

02 Jan 2025 05:40PM UTC coverage: 87.209%. Remained the same
12586431667

Pull #1700

github

web-flow
Merge 35a8d97a0 into 0e8d27442
Pull Request #1700: build(deps): bump cross-spawn from 7.0.3 to 7.0.6

591 of 656 branches covered (90.09%)

Branch coverage included in aggregate %.

1584 of 1838 relevant lines covered (86.18%)

24.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/main/menu.ts
1
import { Menu, MenuItem } from 'electron';
×
2
import { autoUpdater } from 'electron-updater';
×
3
import type { Menubar } from 'menubar';
4
import { openLogsDirectory, resetApp, takeScreenshot } from './utils';
×
5

6
export default class MenuBuilder {
×
7
  private checkForUpdatesMenuItem: MenuItem;
8
  private updateAvailableMenuItem: MenuItem;
9
  private updateReadyForInstallMenuItem: MenuItem;
10

11
  menubar: Menubar;
12

13
  constructor(menubar: Menubar) {
14
    this.menubar = menubar;
×
15

16
    this.checkForUpdatesMenuItem = new MenuItem({
×
17
      label: 'Check for updates',
18
      enabled: true,
19
      click: () => {
20
        autoUpdater.checkForUpdatesAndNotify();
×
21
      },
22
    });
23

24
    this.updateAvailableMenuItem = new MenuItem({
×
25
      label: 'An update is available',
26
      enabled: false,
27
      visible: false,
28
    });
29

30
    this.updateReadyForInstallMenuItem = new MenuItem({
×
31
      label: 'Restart to update',
32
      visible: false,
33
      click: () => {
34
        autoUpdater.quitAndInstall();
×
35
      },
36
    });
37
  }
38

39
  buildMenu(): Menu {
40
    const contextMenu = Menu.buildFromTemplate([
×
41
      this.checkForUpdatesMenuItem,
42
      this.updateAvailableMenuItem,
43
      this.updateReadyForInstallMenuItem,
44
      { type: 'separator' },
45
      {
46
        label: 'Developer',
47
        submenu: [
48
          {
49
            role: 'reload',
50
            accelerator: 'CommandOrControl+R',
51
          },
52
          {
53
            role: 'toggleDevTools',
54
            accelerator:
55
              process.platform === 'darwin' ? 'Alt+Cmd+I' : 'Ctrl+Shift+I',
×
56
          },
57
          {
58
            label: 'Take Screenshot',
59
            accelerator: 'CommandOrControl+S',
60
            click: () => takeScreenshot(this.menubar),
×
61
          },
62
          {
63
            label: 'View Application Logs',
64
            click: () => openLogsDirectory(),
×
65
          },
66
          {
67
            label: 'Reset App',
68
            click: () => {
69
              resetApp(this.menubar);
×
70
            },
71
          },
72
        ],
73
      },
74
      { type: 'separator' },
75
      {
76
        label: 'Quit Gitify',
77
        accelerator: 'CommandOrControl+Q',
78
        click: () => {
79
          this.menubar.app.quit();
×
80
        },
81
      },
82
    ]);
83

84
    return contextMenu;
×
85
  }
86

87
  setCheckForUpdatesMenuEnabled(enabled: boolean) {
88
    this.checkForUpdatesMenuItem.enabled = enabled;
×
89
  }
90

91
  setUpdateAvailableMenuEnabled(enabled: boolean) {
92
    this.updateAvailableMenuItem.enabled = enabled;
×
93
  }
94

95
  setUpdateReadyForInstallMenuEnabled(enabled: boolean) {
96
    this.updateReadyForInstallMenuItem.enabled = enabled;
×
97
  }
98

99
  isUpdateAvailableMenuVisible() {
100
    return this.updateAvailableMenuItem.visible;
×
101
  }
102
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc