File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,16 @@ async def initialize(self) -> None:
120
120
# YDoc not found in the YStore, create the document from the source file (no change history)
121
121
pass
122
122
123
- if not read_from_source :
123
+ if read_from_source :
124
+ self ._emit (LogLevel .INFO , "load" , "Content loaded from disk." )
125
+ self .log .info (
126
+ "Content in room %s loaded from file %s" , self ._room_id , self ._file .path
127
+ )
128
+ self ._document .source = model ["content" ]
129
+
130
+ if self .ystore :
131
+ await self .ystore .encode_state_as_update (self .ydoc )
132
+ else :
124
133
# if YStore updates and source file are out-of-sync, resync updates with source
125
134
if self ._document .source != model ["content" ]:
126
135
# TODO: Delete document from the store.
@@ -134,15 +143,6 @@ async def initialize(self) -> None:
134
143
)
135
144
read_from_source = True
136
145
137
- if read_from_source :
138
- self ._emit (LogLevel .INFO , "load" , "Content loaded from disk." )
139
- self .log .info (
140
- "Content in room %s loaded from file %s" , self ._room_id , self ._file .path
141
- )
142
- self ._document .source = model ["content" ]
143
-
144
- if self .ystore :
145
- await self .ystore .encode_state_as_update (self .ydoc )
146
146
147
147
self ._document .dirty = False
148
148
self .ready = True
You can’t perform that action at this time.
0 commit comments