Use serde to serialize responses (#96)

This commit is contained in:
TrueDoctor
2021-05-07 02:47:38 -07:00
committed by Keavon Chambers
parent 9ad5f4ce78
commit 721a442b75
13 changed files with 99 additions and 45 deletions
@@ -328,12 +328,13 @@ export default defineComponent({
},
},
mounted() {
registerResponseHandler(ResponseType["Tool::UpdateCanvas"], (responseData) => {
this.viewportSvg = responseData;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
registerResponseHandler(ResponseType["Tool::UpdateCanvas"], (responseData: any) => {
this.viewportSvg = responseData.Tool.UpdateCanvas.document;
});
registerResponseHandler(ResponseType["Tool::SetActiveTool"], (responseData) => {
const [activeTool] = responseData;
this.activeTool = activeTool;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
registerResponseHandler(ResponseType["Tool::SetActiveTool"], (responseData: any) => {
this.activeTool = responseData.Tool.SetActiveTool.tool_name;
});
window.addEventListener("keyup", (e: KeyboardEvent) => this.keyUp(e));