Fix empty string in some messages

This commit is contained in:
2025-05-04 19:33:30 +02:00
parent 0237f79ada
commit 35999e93ae

View File

@@ -28,7 +28,7 @@ app.state.auto_polling = False
app.state.polling_rate = 5
app.state.enable_libretranslate = True
app.state.client_state = "idle"
app.state.latest_message = ""
app.state.latest_message = None
# Define the media directory
MEDIA_DIR = Path("./media")
@@ -130,6 +130,7 @@ async def control_endpoint(request: Request):
if data['command'] == "getselectedmessage":
message = await fetch_selected_message()
message = None if message == "" else message
await process_selected_message(message)
logger.info(f"Received new selected message initiated from control: {message}")