diff --git a/visions/server/src/core.rs b/visions/server/src/core.rs
index c4e4631..9bb4c9f 100644
--- a/visions/server/src/core.rs
+++ b/visions/server/src/core.rs
@@ -118,7 +118,7 @@ impl Core {
state.tabletop.background_image = Some(asset.clone());
state.tabletop.clone()
};
- self.publish(Message::UpdateTabletop(tabletop));
+ self.publish(Message::UpdateTabletop(tabletop)).await;
Ok(())
}
diff --git a/visions/server/src/handlers.rs b/visions/server/src/handlers.rs
index 615b447..1dbefec 100644
--- a/visions/server/src/handlers.rs
+++ b/visions/server/src/handlers.rs
@@ -148,7 +148,7 @@ pub async fn handle_connect_websocket(
pub async fn handle_set_background_image(core: Core, image_name: String) -> impl Reply {
handler(async move {
- let _ = core.set_background_image(AssetId::from(image_name));
+ let _ = core.set_background_image(AssetId::from(image_name)).await;
Ok(Response::builder()
.header("Access-Control-Allow-Origin", "*")
@@ -166,6 +166,8 @@ pub async fn handle_get_charsheet(core: Core, charid: String) -> impl Reply {
match sheet {
Some(sheet) => Ok(Response::builder()
+ .header("Access-Control-Allow-Origin", "*")
+ .header("Content-Type", "application/json")
.body(serde_json::to_vec(&sheet).unwrap())
.unwrap()),
None => Ok(Response::builder()
diff --git a/visions/ui/Taskfile.yml b/visions/ui/Taskfile.yml
index 823ef51..172d8e6 100644
--- a/visions/ui/Taskfile.yml
+++ b/visions/ui/Taskfile.yml
@@ -3,5 +3,7 @@ version: '3'
tasks:
dev:
cmds:
+ - cd ../visions-types && task build
+ - npm install
- npm run start
diff --git a/visions/ui/package-lock.json b/visions/ui/package-lock.json
index aac5bfd..807f246 100644
--- a/visions/ui/package-lock.json
+++ b/visions/ui/package-lock.json
@@ -33,7 +33,7 @@
"version": "0.0.1",
"license": "ISC",
"dependencies": {
- "typescript": "^5.6.3"
+ "typescript": "^5.7.2"
}
},
"node_modules/@adobe/css-tools": {
diff --git a/visions/ui/src/App.tsx b/visions/ui/src/App.tsx
index fb49c72..cd6db11 100644
--- a/visions/ui/src/App.tsx
+++ b/visions/ui/src/App.tsx
@@ -12,6 +12,16 @@ interface AppProps {
client: Client;
}
+const CandelaCharsheet = ({ client }: { client: Client }) => {
+ let [sheet, setSheet] = useState(undefined);
+ useEffect(
+ () => { client.charsheet("db7a2585-5dcf-4909-8743-2741111f8b9a").then((c) => setSheet(c)); },
+ [client, setSheet]
+ );
+
+ return sheet ?
{sheet.name} ({sheet.pronouns})
@@ -88,6 +88,7 @@ const CharsheetPanelElement_ = ({ sheet }: CharsheetPanelProps) => {