Skip to content

Commit 86f253c

Browse files
committed
Upgrade deps
ditch electron fetch (as core) switch to module
1 parent 8a0d916 commit 86f253c

File tree

3 files changed

+304
-423
lines changed

3 files changed

+304
-423
lines changed

authentication/electron_devicecode/app/main.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
process.env.CLIENT_ID = '';
22
let scopes = [ 'user:read:email' ];
33

4-
const { app, BrowserWindow, ipcMain, shell } = require('electron')
4+
import { app, BrowserWindow, ipcMain, shell } from 'electron';
55

66
const gotTheLock = app.requestSingleInstanceLock()
77

88
if (!gotTheLock) {
99
app.quit();
10-
return;
1110
}
1211

13-
const path = require('path');
12+
import * as path from 'path';
1413

15-
const Store = require('electron-store');
16-
const { electron } = require('process');
14+
import Store from 'electron-store';
1715
const store = new Store();
1816

19-
const fetch = require('electron-fetch').default
20-
2117
let win;
2218

2319
/*
@@ -115,7 +111,9 @@ function startPolling({ device_code, expires_in, interval }) {
115111
// run
116112
clearInterval(poller);
117113
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);
119117

120118
if (new Date() > expires_at) {
121119
console.log('its dead jim');

0 commit comments

Comments
 (0)