Fix class method bind. Await open promise

a20928b02c635d8ad38f0693bc5291f1ba437a4f

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +3 -3Ignore whitespace
server.js+3 -3
@@ -327,10 +327,10 @@ async function preSetupTasks() {
327327async function postSetupTasks(result) {
328328 const autorunHostname = await cliArgs.getAutorunHostname(result);
329329 const autorunUrl = cliArgs.getAutorunUrl(autorunHostname);
330- console.log('Launching...');
331330
332331 if (cliArgs.autorun) {
333- open(autorunUrl.toString());
332+ console.log('Launching in a browser...');
333+ await open(autorunUrl.toString());
334334 }
335335
336336 setWindowTitle('SillyTavern WebServer');
@@ -457,5 +457,5 @@ initUserStorage(globalThis.DATA_ROOT)
457457 .then(verifySecuritySettings)
458458 .then(preSetupTasks)
459459 .then(apply404Middleware)
460460 .then(() => new ServerStartup(app, cliArgs).start())
461461 .then(postSetupTasks);