From c5929e8cb1a4234daea180dea13e683041d2df61 Mon Sep 17 00:00:00 2001 From: MarcEricMartel Date: Sat, 18 Nov 2023 12:46:31 -0500 Subject: [PATCH] Erratum --- .../Components/Data/CanvasService.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/BlazorCanvas/BlazorCanvas.Server/Components/Data/CanvasService.cs b/BlazorCanvas/BlazorCanvas.Server/Components/Data/CanvasService.cs index ad1c91d..e241ca1 100644 --- a/BlazorCanvas/BlazorCanvas.Server/Components/Data/CanvasService.cs +++ b/BlazorCanvas/BlazorCanvas.Server/Components/Data/CanvasService.cs @@ -6,6 +6,7 @@ using Microsoft.JSInterop; using Newtonsoft.Json.Linq; using Newtonsoft.Json; using System.ComponentModel; +using System.Reflection.Metadata.Ecma335; namespace BlazorCanvas.Server.Components.Data; @@ -61,7 +62,7 @@ public class CanvasService { } } - public async void Init() { + public async void InitStreamer() { while (!_is_init) { _is_init = await _redisService.InitStreamer(); if (!_is_init) @@ -101,10 +102,12 @@ public class CanvasService { if (!_is_started) { if (!_is_init) - Init(); - if (_is_init) + InitStreamer(); + if (_is_init) { Consume(); - _is_started = true; + _is_started = true; + } + return; } if (eventArgs.Buttons == 0 || eventArgs.Buttons > 2) @@ -140,10 +143,6 @@ public class CanvasService { _redisService.Produce(command); // Stream - // _redisService.Publish(command); // Pub/Sub - - // Draw(command); // Local - _lastCommand = command; } }