Skip to content

Commit

Permalink
fix: Send proper message types instead of message
Browse files Browse the repository at this point in the history
Signed-off-by: Colton Wolkins (Laptop) <[email protected]>
  • Loading branch information
TheTechmage committed Apr 2, 2024
1 parent 3fe7094 commit 015f957
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions src/app/wyvern/server-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,22 @@ function openSettings() {
setSettingsModal(true);
}

function openServer(agent, id) {
const message = {
type: "https://didcomm.org/basicmessage/2.0/message",
async function openServer(agent, id) {
const delay = ms => new Promise(res => setTimeout(res, ms));
let message = {
type: "https://developer.wyvrn.app/protocols/serverinfo/1.0/request-role-list",
lang: "en",
body: {
content: "/refresh-users",
content: "",
},
}
agent.sendMessage(id, message)
await delay(500);
message = {
type: "https://developer.wyvrn.app/protocols/serverinfo/1.0/request-user-list",
lang: "en",
body: {
content: "",
},
}
agent.sendMessage(id, message)
Expand All @@ -211,13 +221,13 @@ function ServerIcon({ id, picture, name }) {

function ServerLink({ agent, id, children, name, callback, styles }) {
const router = useRouter();
const call_callback = (event) => {
const call_callback = async (event) => {
if(callback) {
event.preventDefault();
event.stopPropagation();
}
console.log("Opening?", id);
id ? openServer(agent, id) : callback()
id ? (await openServer(agent, id)) : callback()
return false;
}
return (
Expand Down

0 comments on commit 015f957

Please sign in to comment.