@@ -174,7 +174,6 @@ export class YDrive extends Drive implements ICollaborativeDrive {
174
174
this . _providers . set ( key , provider ) ;
175
175
176
176
sharedModel . changed . connect ( async ( _ , change ) => {
177
- // TODO: make use of the hash
178
177
if ( ! change . stateChange ) {
179
178
return ;
180
179
}
@@ -192,29 +191,16 @@ export class YDrive extends Drive implements ICollaborativeDrive {
192
191
const hashChange = hashChanges [ 0 ] ;
193
192
194
193
// A change in hash signifies that a save occurred on the server-side
195
- // (e.g. a collaborator performed the save) - we want notify the observers
196
- // about this change so that they can store the new hash value.
197
-
194
+ // (e.g. a collaborator performed the save) - we want to notify the
195
+ // observers about this change so that they can store the new hash value.
198
196
const model = await this . get ( options . path , { content : false } ) ;
199
- /*
197
+
200
198
this . _ydriveFileChanged . emit ( {
201
- type: 'server-side- save',
202
- newValue: {...model, hash: hashChange.newValue},
199
+ type : 'save' ,
200
+ newValue : { ...model , hash : hashChange . newValue } ,
203
201
// we do not have the old model because it was discarded when server made the change,
204
202
// we only have the old hash here (which may be empty if the file was newly created!)
205
- oldValue: {hash: hashChange.oldValue}
206
- });
207
- */
208
- // TODO: add handler for `server-side-save` in
209
- // https://github.com/jupyterlab/jupyterlab/blob/dca1ec376c66038b8df7001d32cf058c70fcd717/packages/docregistry/src/context.ts#L410-L444
210
- // For now, fake it:
211
- // it happens that "rename" will perform the update of context's internal
212
- // contentsModel (which we desire to solve the spurious "File Changed" dialog)
213
- // even if file path has not changed.
214
- this . _ydriveFileChanged . emit ( {
215
- type : 'rename' ,
216
- newValue : { ...model , hash : hashChange . newValue } ,
217
- oldValue : { ...model , hash : hashChange . oldValue }
203
+ oldValue : { hash : hashChange . oldValue }
218
204
} ) ;
219
205
} ) ;
220
206
0 commit comments