Start animation also in German

The app's new port means empty browser storage, so a German app reloaded right
after the start and lost the animation. The language now comes with the login.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GivouandClaude Opus 5.5 committed 2026-11-02 20:32:35 +01:00
1 parent a639abf216
commit 99613327f8
2 files changed
+6 -3

No files matched your search

+1 -1
View File
@@ -1160,7 +1160,7 @@ class App:
cookie = self.app_login(parse_qs(url.query).get("t", [""])[0]) cookie = self.app_login(parse_qs(url.query).get("t", [""])[0])
if cookie: if cookie:
await self.respond(writer, 302, b"", "text/plain", await self.respond(writer, 302, b"", "text/plain",
"Location: /?start=app\r\n" + self.cookie(cookie, SESSION_TTL)) f"Location: /?start=app&lang={self.lang or 'en'}\r\n" + self.cookie(cookie, SESSION_TTL))
else: else:
await self.respond(writer, 401, b"invalid app token", "text/plain") await self.respond(writer, 401, b"invalid app token", "text/plain")
return return
+5 -2
View File
@@ -17,10 +17,13 @@
<b>DSP Control</b><small>VK-Audio</small> <b>DSP Control</b><small>VK-Audio</small>
</div> </div>
<script> <script>
// start animation of the desktop apps: only their login arrives with this parameter, a reload doesn't // start animation of the desktop apps: only their login arrives with this parameter, a reload doesn't.
// The language comes along: on the app's new port the browser storage is empty, and correcting it later needs a reload
(function () { (function () {
var el = document.getElementById("splash"); var el = document.getElementById("splash");
if (location.search !== "?start=app") return el.remove(); var m = /^\?start=app&lang=(en|de)$/.exec(location.search);
if (!m) return el.remove();
try { localStorage.setItem("dsp.lang", m[1]); } catch (e) { /* private mode */ }
history.replaceState(null, "", "/"); history.replaceState(null, "", "/");
el.classList.add("show"); el.classList.add("show");
setTimeout(function () { el.remove(); }, 1500); setTimeout(function () { el.remove(); }, 1500);