mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-21 21:49:55 +03:00
Changes
This commit is contained in:
parent
d15e6ee0e4
commit
437d6c8b9a
|
@ -3,7 +3,7 @@ import path from 'path';
|
|||
import spawn from 'cross-spawn';
|
||||
import { Options } from '../options';
|
||||
|
||||
export default function openApp(app: boolean | string, options: Options) {
|
||||
export default async function openApp(app: true | string, options: Options) {
|
||||
if (app === true || app === 'electron') {
|
||||
try {
|
||||
const port = options.port ? `--port=${options.port}` : '';
|
||||
|
@ -31,9 +31,9 @@ export default function openApp(app: boolean | string, options: Options) {
|
|||
}
|
||||
return;
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
open(
|
||||
|
||||
await open(
|
||||
`http://localhost:${options.port}/`,
|
||||
app !== 'browser' ? { app: app as string } : undefined
|
||||
app !== 'browser' ? { app: { name: app } } : undefined
|
||||
);
|
||||
}
|
||||
|
|
|
@ -90,8 +90,8 @@ if (argv.injectserver) {
|
|||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
server(argv).then(function (r) {
|
||||
if (argv.open && argv.open !== 'false') {
|
||||
r.on('ready', function () {
|
||||
openApp(argv.open, options);
|
||||
r.on('ready', async function () {
|
||||
await openApp(argv.open, options);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
|
@ -14,7 +14,7 @@ export interface ExtendedOptions extends Options {
|
|||
|
||||
export default function (argv: { [arg: string]: any }): Promise<{
|
||||
portAlreadyUsed?: boolean;
|
||||
on: (status: 'ready', cb: () => void) => void;
|
||||
on: (status: 'ready', cb: (() => void) | (() => Promise<void>)) => void;
|
||||
}> {
|
||||
const options = Object.assign(getOptions(argv), {
|
||||
workerController: __dirname + '/worker.js',
|
||||
|
|
Loading…
Reference in New Issue
Block a user