switching networks works, established server functions
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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 = ""
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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 = ""
|
||||
}
|
||||
})
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user