diff --git a/appServer.go b/appServer.go index 275567a..92d6b1b 100644 --- a/appServer.go +++ b/appServer.go @@ -156,14 +156,7 @@ func (app *application) socketReader(bridge webBridge) { ErrorLog(`"session" key not found`) } - answer := "" - if session, answer = app.startSession(obj, events, bridge); session != nil { - if !bridge.writeMessage(answer) { - return - } - session.onStart() - go sessionEventHandler(session, events, bridge) - } + bridge.writeMessage("restartSession();") case "answer": session.handleAnswer(obj) diff --git a/app_scripts.js b/app_scripts.js index f320470..318d96b 100644 --- a/app_scripts.js +++ b/app_scripts.js @@ -73,6 +73,10 @@ function sessionInfo() { return message + "}"; } +function restartSession() { + sendMessage( sessionInfo() ); +} + function getIntAttribute(element, tag) { let value = element.getAttribute(tag); if (value) {