Timothy Jaeryang Baek 3 달 전
부모
커밋
01420fd189
2개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 1 1
      backend/open_webui/socket/main.py
  2. 4 4
      src/lib/components/common/RichTextInput.svelte

+ 1 - 1
backend/open_webui/socket/main.py

@@ -449,6 +449,7 @@ async def yjs_document_update(sid, data):
         await stop_item_tasks(REDIS, document_id)
         await stop_item_tasks(REDIS, document_id)
 
 
         user_id = data.get("user_id", sid)
         user_id = data.get("user_id", sid)
+
         update = data["update"]  # List of bytes from frontend
         update = data["update"]  # List of bytes from frontend
 
 
         if document_id not in DOCUMENTS:
         if document_id not in DOCUMENTS:
@@ -484,7 +485,6 @@ async def yjs_document_update(sid, data):
                 document_id, data.get("data", {}), SESSION_POOL.get(sid)
                 document_id, data.get("data", {}), SESSION_POOL.get(sid)
             )
             )
 
 
-        await stop_item_tasks(REDIS, document_id)  # Cancel previous in-flight save
         await create_task(REDIS, debounced_save(), document_id)
         await create_task(REDIS, debounced_save(), document_id)
 
 
     except Exception as e:
     except Exception as e:

+ 4 - 4
src/lib/components/common/RichTextInput.svelte

@@ -289,15 +289,15 @@
 			}
 			}
 		}
 		}
 
 
-		onConnect() {
+		onConnect = () => {
 			this.isConnected = true;
 			this.isConnected = true;
 			this.joinDocument();
 			this.joinDocument();
-		}
+		};
 
 
-		onDisconnect() {
+		onDisconnect = () => {
 			this.isConnected = false;
 			this.isConnected = false;
 			this.synced = false;
 			this.synced = false;
-		}
+		};
 
 
 		destroy() {
 		destroy() {
 			this.socket.off('yjs:document:update');
 			this.socket.off('yjs:document:update');