Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
timothe
duniter
Commits
c6e317ce
Commit
c6e317ce
authored
May 27, 2020
by
Éloïs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] async dep upgrade break wizard network
parent
7f1f4218
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
18 deletions
+18
-18
app/modules/bma/index.ts
app/modules/bma/index.ts
+18
-18
No files found.
app/modules/bma/index.ts
View file @
c6e317ce
...
...
@@ -355,7 +355,11 @@ export function networkReconfiguration(
)
{
async
.
waterfall
(
[
upnpResolve
.
bind
(
null
,
noupnp
,
logger
),
function
(
next
:
(
arg0
:
null
,
arg1
:
boolean
,
conf
:
NetworkConfDTO
)
=>
any
)
{
return
upnpResolve
(
!
conf
.
upnp
,
logger
,
next
);
},
function
(
upnpSuccess
:
boolean
,
upnpConf
:
NetworkConfDTO
,
next
:
any
)
{
// Default values
conf
.
port
=
conf
.
port
||
BMAConstants
.
DEFAULT_PORT
;
...
...
@@ -470,20 +474,24 @@ export function networkReconfiguration(
async
function
upnpResolve
(
noupnp
:
boolean
,
logger
:
any
,
do
ne
:
(
arg0
:
null
,
arg1
:
boolean
,
conf
:
Object
)
=>
any
ne
xt
:
(
arg0
:
null
,
arg1
:
boolean
,
conf
:
Object
)
=>
any
)
{
try
{
let
conf
=
await
Network
.
upnpConf
(
noupnp
,
logger
);
do
ne
(
null
,
true
,
conf
);
ne
xt
(
null
,
true
,
conf
);
}
catch
(
err
)
{
do
ne
(
null
,
false
,
{});
ne
xt
(
null
,
false
,
{});
}
}
function
networkConfiguration
(
conf
:
NetworkConfDTO
,
logger
:
any
,
done
:
any
)
{
async
.
waterfall
(
[
upnpResolve
.
bind
(
null
,
!
conf
.
upnp
,
logger
),
function
(
next
:
(
arg0
:
null
,
arg1
:
boolean
,
conf
:
NetworkConfDTO
)
=>
any
)
{
return
upnpResolve
(
!
conf
.
upnp
,
logger
,
next
);
},
function
(
upnpSuccess
:
boolean
,
upnpConf
:
NetworkConfDTO
,
next
:
any
)
{
let
operations
=
getLocalNetworkOperations
(
conf
).
concat
(
getRemoteNetworkOperations
(
conf
,
upnpConf
.
remoteipv4
)
...
...
@@ -664,26 +672,18 @@ function getRemoteNetworkOperations(
}
});
},
async
function
(
answers
:
any
,
next
:
any
)
{
function
(
answers
:
any
,
next
:
any
)
{
conf
.
remoteipv4
=
answers
.
remoteipv4
;
try
{
if
(
conf
.
remoteipv4
||
conf
.
remotehost
)
{
await
new
Promise
((
resolve
,
reject
)
=>
{
const
getPort
=
async
.
apply
(
simpleInteger
,
"
Remote port
"
,
"
remoteport
"
,
conf
);
getPort
((
err
:
any
)
=>
{
if
(
err
)
return
reject
(
err
);
resolve
();
});
simpleInteger
(
"
Remote port
"
,
"
remoteport
"
,
conf
,
(
err
:
any
)
=>
{
if
(
err
)
throw
err
;
next
();
});
}
else
if
(
conf
.
remoteipv6
)
{
conf
.
remoteport
=
conf
.
port
;
next
();
}
next
();
}
catch
(
e
)
{
next
(
e
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment