diff --git a/src/happyx/spa/renderer.nim b/src/happyx/spa/renderer.nim index 6c000b83..27f38f62 100644 --- a/src/happyx/spa/renderer.nim +++ b/src/happyx/spa/renderer.nim @@ -218,6 +218,7 @@ else: proc js*(comp: BaseComponent, script: string) = componentsResult[comp.uniqCompId] = "script:" & fmt"" proc rerender*(query, queryArr, reqMethod, inCookies, headers: auto, hostname, urlPath: string) = + echo "rerender for " & hostname requestResult[hostname] = "rerender:" & liveviewRoutes[urlPath]( query, queryArr, reqMethod, inCookies, headers, nil ).children[1].ugly() diff --git a/src/happyx/ssr/liveviews/liveviews.nim b/src/happyx/ssr/liveviews/liveviews.nim index 4d54ee79..5d276add 100644 --- a/src/happyx/ssr/liveviews/liveviews.nim +++ b/src/happyx/ssr/liveviews/liveviews.nim @@ -112,15 +112,9 @@ proc handleLiveViews*(body: NimNode) = componentsResult.del(comp.uniqCompId) of 1: eventHandlers[parsed["idx"].getInt](parsed["ev"]) - when enableHttpBeast or enableHttpx: - let hostname = $int(req.client) - if requestResult.hasKey(hostname): - await wsClient.send($requestResult[hostname]) - requestResult.del(hostname) - else: - if requestResult.hasKey(req.hostname): - await wsClient.send($requestResult[req.hostname]) - requestResult.del(req.hostname) + if requestResult.hasKey(hostname): + await wsClient.send($requestResult[hostname]) + requestResult.del(hostname) else: discard body.add(wsMethod)