diff --git a/zndraw/app.py b/zndraw/app.py index da1df5f85..477e18cc4 100644 --- a/zndraw/app.py +++ b/zndraw/app.py @@ -2,7 +2,7 @@ import multiprocessing as mp import uuid -from flask import Flask, render_template, request, session, redirect +from flask import Flask, redirect, render_template, request, session from flask_socketio import SocketIO, emit, join_room from zndraw.data import atoms_from_json @@ -50,11 +50,13 @@ def index(): uuid=session["uuid"], ) + @app.route("/token/") def token(token): session["uuid"] = token return redirect("/") - + + @io.on("join") def on_join(data): """Join a room.""" diff --git a/zndraw/templates/index.html b/zndraw/templates/index.html index 57aa96b74..86b477cb7 100644 --- a/zndraw/templates/index.html +++ b/zndraw/templates/index.html @@ -510,7 +510,7 @@

Share Link

const url = window.location.href.replace(/\/$/, ""); const target_href = "{{ url_for('token', token=uuid) }}"; const full_url = url + target_href; - + document.getElementById("share-link-block").innerHTML = full_url; document.getElementById("btnShareLink").onclick = function(event) {