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

gitify-app / gitify / 13089087317

01 Feb 2025 01:27PM UTC coverage: 87.327% (-0.04%) from 87.364%
13089087317

Pull #1803

github

web-flow
Merge 03177131f into 2e515d06c
Pull Request #1803: fix(deps): update react-router-dom to v7.1.5

639 of 716 branches covered (89.25%)

Branch coverage included in aggregate %.

1697 of 1959 relevant lines covered (86.63%)

25.09 hits per line

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

34.38
/src/main/utils.ts
1
import fs from 'node:fs';
2✔
2
import os from 'node:os';
2✔
3
import path from 'node:path';
2✔
4
import { dialog, shell } from 'electron';
2✔
5
import log from 'electron-log';
2✔
6
import type { Menubar } from 'menubar';
7

8
import { APPLICATION } from '../shared/constants';
2✔
9
import { namespacedEvent } from '../shared/events';
2✔
10
import { logError, logInfo } from '../shared/logger';
2✔
11

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

16
  const capturedPicFilePath = path.join(
×
17
    os.homedir(),
18
    `${dateStr}-${APPLICATION.NAME}-screenshot.png`,
19
  );
20
  mb.window.capturePage().then((img) => {
×
21
    fs.writeFile(capturedPicFilePath, img.toPNG(), () =>
×
22
      logInfo('takeScreenshot', `Screenshot saved ${capturedPicFilePath}`),
×
23
    );
24
  });
25
}
26

27
export function resetApp(mb: Menubar) {
2✔
28
  const cancelButtonId = 0;
×
29
  const resetButtonId = 1;
×
30

31
  const response = dialog.showMessageBoxSync(mb.window, {
×
32
    type: 'warning',
33
    title: `Reset ${APPLICATION.NAME}`,
34
    message: `Are you sure you want to reset ${APPLICATION.NAME}? You will be logged out of all accounts`,
35
    buttons: ['Cancel', 'Reset'],
36
    defaultId: cancelButtonId,
37
    cancelId: cancelButtonId,
38
  });
39

40
  if (response === resetButtonId) {
×
41
    mb.window.webContents.send(namespacedEvent('reset-app'));
×
42
    mb.app.quit();
×
43
  }
44
}
45

46
export function openLogsDirectory() {
2✔
47
  const logDirectory = path.dirname(log.transports.file?.getFile()?.path);
×
48

49
  if (!logDirectory) {
×
50
    logError(
×
51
      'openLogsDirectory',
52
      'Could not find log directory!',
53
      new Error('Directory not found'),
54
    );
55
    return;
×
56
  }
57

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