switching networks works, established server functions

This commit is contained in:
metacryst
2026-01-16 05:22:52 -06:00
parent d2982543d0
commit d3df5bb6cb
31 changed files with 410 additions and 310 deletions

View File

@@ -20,6 +20,15 @@ class Dashboard extends Shadow {
render() {
VStack(() => {
if(window.location.pathname.startsWith("/my")) {
h1(global.profile.name);
return
}
else if(!window.location.pathname.includes("comalyr")) {
return
}
h1("Website Inquiries");
p("Contact Us")
@@ -41,7 +50,7 @@ class Dashboard extends Shadow {
.maxWidth(95, pct)
.gap(8);
window.currentNetwork.data.contact.forEach((entry) => {
global.currentNetwork.data.contact.forEach((entry) => {
HStack(() => {
this.cell("time", entry.time);
this.cell("fname", entry.fname);
@@ -74,7 +83,7 @@ class Dashboard extends Shadow {
.maxWidth(95, pct)
.gap(8);
window.currentNetwork.data.join.forEach((entry) => {
global.currentNetwork.data.join.forEach((entry) => {
HStack(() => {
this.cell("time", entry.time);
this.cell("fname", entry.fname);

View File

@@ -79,7 +79,7 @@ class Forum extends Shadow {
.fontSize(1, em)
.onKeyDown(function (e) {
if (e.key === "Enter") {
window.Socket.send({app: "FORUM", operation: "SEND", msg: {forum: "HY", text: this.value }})
global.Socket.send({app: "FORUM", operation: "SEND", msg: {forum: "HY", text: this.value }})
this.value = ""
}
})

View File

@@ -65,7 +65,7 @@ class Messages extends Shadow {
.fontSize(1, em)
.onKeyDown((e) => {
if (e.key === "Enter") {
window.Socket.send({app: "MESSAGES", operation: "SEND", msg: { conversation: `CONVERSATION-${this.selectedConvoID}`, text: e.target.value }})
global.Socket.send({app: "MESSAGES", operation: "SEND", msg: { conversation: `CONVERSATION-${this.selectedConvoID}`, text: e.target.value }})
e.target.value = ""
}
})
@@ -104,7 +104,7 @@ class Messages extends Shadow {
.color("var(--accent)")
.onKeyDown(function (e) {
if (e.key === "Enter") {
window.Socket.send({app: "MESSAGES", operation: "ADDCONVERSATION", msg: {email: this.value }})
global.Socket.send({app: "MESSAGES", operation: "ADDCONVERSATION", msg: {email: this.value }})
this.value = ""
}
})

View File

@@ -13,7 +13,7 @@ class MessagesPanel extends Shadow {
if(this.messages) {
for(let i=0; i<this.messages.length; i++) {
let message = this.messages[i]
let fromMe = window.profile.email === message.from.email
let fromMe = global.profile.email === message.from.email
VStack(() => {
HStack(() => {
p(message.from.firstName + " " + message.from.lastName)

View File

@@ -57,7 +57,7 @@ class MessagesSidebar extends Shadow {
let membersString = ""
for(let i=0; i<members.length; i++) {
let member = members[i]
if(member.email === window.profile.email) {
if(member.email === global.profile.email) {
continue;
}
if(members.length > 2) {

View File

@@ -5,8 +5,8 @@ class People extends Shadow {
.fontWeight("bold")
.marginBottom(2, em)
for(let i = 0; i < window.currentNetwork.data.members.length; i++) {
let member = window.currentNetwork.data.members[i]
for(let i = 0; i < global.currentNetwork.data.members.length; i++) {
let member = global.currentNetwork.data.members[i]
HStack(() => {
p(member.firstName + " " + member.lastName)
.width(10, pct)