Skip to content

Commit

Permalink
v1.6.2
Browse files Browse the repository at this point in the history
  • Loading branch information
p-sam committed Mar 19, 2021
2 parents fcb1f15 + efc830e commit 8ccd4d4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
language: node_js
node_js: '12'
node_js: '14'
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Electron helper to prompt for a value via input or select

[![Build Status](https://travis-ci.com/p-sam/electron-prompt.svg?branch=master)](https://travis-ci.com/p-sam/electron-prompt) [![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/xojs/xo)

<p align="center"><img width="482" alt="prompt-preview" src="https://user-images.githubusercontent.com/17620180/111753337-09c0c680-8897-11eb-8ce8-43de29c143bd.png"></p>

## Usage

```sh
Expand Down
8 changes: 5 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const DEFAULT_HEIGHT = 160;

function electronPrompt(options, parentWindow) {
return new Promise((resolve, reject) => {
const id = `${new Date().getTime()}-${Math.random()}`;
const id = `${Date.now()}-${Math.random()}`;

const options_ = Object.assign(
{
Expand All @@ -36,7 +36,8 @@ function electronPrompt(options, parentWindow) {
);

if (options_.type === 'select' && (options_.selectOptions === null || typeof options_.selectOptions !== 'object')) {
return reject(new Error('"selectOptions" must be an object'));
reject(new Error('"selectOptions" must be an object'));
return;
}

let promptWindow = new BrowserWindow({
Expand All @@ -56,7 +57,8 @@ function electronPrompt(options, parentWindow) {
title: options_.title,
icon: options_.icon || undefined,
webPreferences: {
nodeIntegration: true
nodeIntegration: true,
contextIsolation: false
}
});

Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "electron-prompt",
"version": "1.6.1",
"version": "1.6.2",
"description": "Electron helper to prompt for a value via input or select",
"keywords": [
"electron",
Expand Down Expand Up @@ -28,12 +28,15 @@
"env": [
"node",
"browser"
]
],
"rules": {
"unicorn/prefer-ternary": 0
}
},
"dependencies": {
"doc-ready": "^1.0.4"
},
"devDependencies": {
"xo": "^0.32.1"
"xo": "^0.38.2"
}
}

0 comments on commit 8ccd4d4

Please sign in to comment.