rebranding to forum, adding settings and stripe page

This commit is contained in:
metacryst
2026-02-20 03:51:31 -06:00
parent aaf9d56b1b
commit dd9552aad1
19 changed files with 113 additions and 14 deletions

View File

@@ -28,6 +28,18 @@ let Global = class {
}
onNavigate = async () => {
console.log("onnavigate", this.getFirstPathSegment())
if(this.getFirstPathSegment() === "stripe") {
const params = new URLSearchParams(window.location.search);
const code = params.get("code");
if (code) {
// send this code to your backend
console.log("success!: ", code)
} else {
throw new Error("Stripe code is not present!")
}
}
let selectedNetwork = this.networkFromPath()
let selectedApp = this.appFromPath()
@@ -71,7 +83,7 @@ let Global = class {
window.dispatchEvent(event)
}
document.title = (this.currentNetwork === this.profile) ? "Parchment" : `${this.currentNetwork.abbreviation} | Parchment`
document.title = (this.currentNetwork === this.profile) ? "Forum" : `${this.currentNetwork.abbreviation} | Forum`
}
setCurrentNetworkAndApp() {
@@ -89,9 +101,12 @@ let Global = class {
return defaultNetwork.apps[0].toLowerCase()
}
getFirstPathSegment() {
return window.location.pathname.split('/').filter(Boolean)[0] || '';
}
networkFromPath = function () {
const pathname = window.location.pathname;
const firstSegment = pathname.split('/').filter(Boolean)[0] || '';
const firstSegment = this.getFirstPathSegment()
if(firstSegment === "my") {
return this.profile
} else {