Skip to content

Commit

Permalink
[fix]
Browse files Browse the repository at this point in the history
  • Loading branch information
boke0 committed Mar 14, 2021
1 parent 88f542f commit 6564d52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion kyokusui/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ def retrieve(self, request):
return Response.render(template, {
"board": board,
"thread": thread,
"boards": Board.list_subscribed(request.user)
"boards": Board.list_subscribed(request.user),
"ws_scheme": "ws" if request.scheme == "http" else "wss"
})

def log(self, request):
Expand Down
2 changes: 1 addition & 1 deletion kyokusui/templates/thread.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ <h5 class='modal-title'>スレッドを締めますか?</h5>
const textarea = document.querySelector("#message")
const image_form = document.querySelector("#image")
const image2send = document.querySelector("#image2send")
const ws = new WebSocket("{{ fullurl(request, "/api/v0/board/" + board._id + "/" + thread._id + "/socket", scheme="ws" if request.scheme == "http" else "wss") }}")
const ws = new WebSocket("{{ fullurl(request, "/api/v0/board/" + board._id + "/" + thread._id + "/socket", scheme=ws_scheme) }}")
image_form.onchange = async e => {
const files = await Promise.all(Array.from(e.target.files).map(f => {
return new Promise((resolve, reject) => {
Expand Down

0 comments on commit 6564d52

Please sign in to comment.