"browse" goes to jumble instead of self-hosted jouble.

This commit is contained in:
fiatjaf 2025-04-25 17:48:35 -03:00
parent 34ab0272c7
commit 66e0c849fc
3 changed files with 1 additions and 30 deletions

View File

@ -91,31 +91,3 @@ func reportsViewerHandler(w http.ResponseWriter, r *http.Request) {
reportsPage(events, getLoggedUser(r)).Render(r.Context(), w)
}
func joubleHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, `
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>pyramid</title>
<script>
window.relayGroups = [{
groupName: 'pyramid',
relayUrls: [location.href.replace('http', 'ws').replace('/browse', '')],
isActive: true,
}]
window.hideRelaySettings = true
</script>
<script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/jouble@0.0.6/dist/index.js"></script>
<link rel="stylesheet" crossorigin href="https://cdn.jsdelivr.net/npm/jouble@0.0.6/dist/index.css">
</head>
<body>
<div id="root"></div>
<script src="https://cdn.jsdelivr.net/npm/window.nostr.js@0.4.7/dist/window.nostr.min.js"></script>
</body>
</html>
`)
}

View File

@ -21,7 +21,7 @@ templ layout(loggedUser string) {
</div>
<nav class="flex flex-1 items-center justify-center">
<a href="/" class="text-gray-600 hover:bg-gray-200 rounded-md px-3 py-2 font-medium" hx-boost="true" hx-target="main" hx-select="main">invite tree</a>
<a href="/browse" class="text-gray-600 hover:bg-gray-200 rounded-md px-3 py-2 font-medium">browse</a>
<a target="_blank" class="text-gray-600 hover:bg-gray-200 rounded-md px-3 py-2 font-medium" _="on load set my href to `https://jumble.social/?r=${location.hostname}`">browse</a>
<a href="/reports" class="text-gray-600 hover:bg-gray-200 rounded-md px-3 py-2 font-medium" hx-boost="true" hx-target="main" hx-select="main">reports</a>
if loggedUser == s.RelayPubkey {
<a href="/cleanup" class="text-gray-600 hover:bg-gray-200 rounded-md px-3 py-2 font-medium">clear stuff</a>

View File

@ -135,7 +135,6 @@ func main() {
relay.Router().HandleFunc("/remove-from-whitelist", removeFromWhitelistHandler)
relay.Router().HandleFunc("/cleanup", cleanupStuffFromExcludedUsersHandler)
relay.Router().HandleFunc("/reports", reportsViewerHandler)
relay.Router().HandleFunc("/browse/", joubleHandler)
relay.Router().Handle("/static/", http.FileServer(http.FS(static)))
relay.Router().HandleFunc("/favicon.ico", func(w http.ResponseWriter, r *http.Request) {
if s.RelayIcon != "" {