|
1 | 1 | process.env.CLIENT_ID = ''; |
2 | 2 | let scopes = [ 'user:read:email' ]; |
3 | 3 |
|
4 | | -const { app, BrowserWindow, ipcMain, shell } = require('electron') |
| 4 | +import { app, BrowserWindow, ipcMain, shell } from 'electron'; |
5 | 5 |
|
6 | 6 | const gotTheLock = app.requestSingleInstanceLock() |
7 | 7 |
|
8 | 8 | if (!gotTheLock) { |
9 | 9 | app.quit(); |
10 | | - return; |
11 | 10 | } |
12 | 11 |
|
13 | | -const path = require('path'); |
| 12 | +import * as path from 'path'; |
14 | 13 |
|
15 | | -const Store = require('electron-store'); |
16 | | -const { electron } = require('process'); |
| 14 | +import Store from 'electron-store'; |
17 | 15 | const store = new Store(); |
18 | 16 |
|
19 | | -const fetch = require('electron-fetch').default |
20 | | - |
21 | 17 | let win; |
22 | 18 |
|
23 | 19 | /* |
@@ -115,7 +111,9 @@ function startPolling({ device_code, expires_in, interval }) { |
115 | 111 | // run |
116 | 112 | clearInterval(poller); |
117 | 113 | poller = setInterval(() => { |
118 | | - console.log(new Date(), '>', expires_at); |
| 114 | + let timLeft = expires_at - new Date(); |
| 115 | + let seconds = Math.floor(timLeft / 1000); |
| 116 | + console.log(new Date(), '>', expires_at, '-', seconds); |
119 | 117 |
|
120 | 118 | if (new Date() > expires_at) { |
121 | 119 | console.log('its dead jim'); |
|
0 commit comments