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

gitify-app / gitify / 12684787848

09 Jan 2025 06:28AM UTC coverage: 87.209%. Remained the same
12684787848

Pull #1713

github

web-flow
Merge e3271033b into 67b95de9d
Pull Request #1713: chore(deps): update typescript to v5.7.3

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/utils.ts
1
import fs from 'node:fs';
×
2
import os from 'node:os';
×
3
import path from 'node:path';
×
4
import { dialog, shell } from 'electron';
×
5
import log from 'electron-log';
×
6
import type { Menubar } from 'menubar';
7

8
import { logError, logInfo } from '../shared/logger';
×
9

10
export function takeScreenshot(mb: Menubar) {
×
11
  const date = new Date();
×
12
  const dateStr = date.toISOString().replace(/:/g, '-');
×
13

14
  const capturedPicFilePath = `${os.homedir()}/${dateStr}-gitify-screenshot.png`;
×
15
  mb.window.capturePage().then((img) => {
×
16
    fs.writeFile(capturedPicFilePath, img.toPNG(), () =>
×
17
      logInfo('takeScreenshot', `Screenshot saved ${capturedPicFilePath}`),
×
18
    );
19
  });
20
}
21

22
export function resetApp(mb: Menubar) {
×
23
  const cancelButtonId = 0;
×
24
  const resetButtonId = 1;
×
25

26
  const response = dialog.showMessageBoxSync(mb.window, {
×
27
    type: 'warning',
28
    title: 'Reset Gitify',
29
    message:
30
      'Are you sure you want to reset Gitify? You will be logged out of all accounts',
31
    buttons: ['Cancel', 'Reset'],
32
    defaultId: cancelButtonId,
33
    cancelId: cancelButtonId,
34
  });
35

36
  if (response === resetButtonId) {
×
37
    mb.window.webContents.send('gitify:reset-app');
×
38
    mb.app.quit();
×
39
  }
40
}
41

42
export function openLogsDirectory() {
×
43
  const logDirectory = path.dirname(log.transports.file?.getFile()?.path);
×
44

45
  if (!logDirectory) {
×
46
    logError(
×
47
      'openLogsDirectory',
48
      'Could not find log directory!',
49
      new Error('Directory not found'),
50
    );
51
    return;
×
52
  }
53

54
  shell.openPath(logDirectory);
×
55
}
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