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

gitify-app / gitify / 12340322989

15 Dec 2024 04:10PM UTC coverage: 87.342%. Remained the same
12340322989

Pull #1643

github

web-flow
Merge 67ddbb2f2 into 3d6b2bab6
Pull Request #1643: fix(deps): update dependency react-router-dom to v7

585 of 648 branches covered (90.28%)

Branch coverage included in aggregate %.

1561 of 1809 relevant lines covered (86.29%)

24.57 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
export function takeScreenshot(mb: Menubar) {
×
9
  const date = new Date();
×
10
  const dateStr = date.toISOString().replace(/:/g, '-');
×
11

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

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

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

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

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

43
  if (!logDirectory) {
×
44
    log.error('Could not find log directory!');
×
45
    return;
×
46
  }
47

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