mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-04 20:06:06 +02:00
This commit is contained in:
@@ -247,7 +247,10 @@
|
||||
|
||||
this.mixin('i');
|
||||
this.mixin('api');
|
||||
this.mixin('stream');
|
||||
|
||||
this.mixin('drive-stream');
|
||||
this.connection = this.driveStream.getConnection();
|
||||
this.connectionId = this.driveStream.use();
|
||||
|
||||
this.files = [];
|
||||
this.folders = [];
|
||||
@@ -280,10 +283,10 @@
|
||||
});
|
||||
});
|
||||
|
||||
this.stream.on('drive_file_created', this.onStreamDriveFileCreated);
|
||||
this.stream.on('drive_file_updated', this.onStreamDriveFileUpdated);
|
||||
this.stream.on('drive_folder_created', this.onStreamDriveFolderCreated);
|
||||
this.stream.on('drive_folder_updated', this.onStreamDriveFolderUpdated);
|
||||
this.connection.on('file_created', this.onStreamDriveFileCreated);
|
||||
this.connection.on('file_updated', this.onStreamDriveFileUpdated);
|
||||
this.connection.on('folder_created', this.onStreamDriveFolderCreated);
|
||||
this.connection.on('folder_updated', this.onStreamDriveFolderUpdated);
|
||||
|
||||
if (this.opts.folder) {
|
||||
this.move(this.opts.folder);
|
||||
@@ -293,10 +296,11 @@
|
||||
});
|
||||
|
||||
this.on('unmount', () => {
|
||||
this.stream.off('drive_file_created', this.onStreamDriveFileCreated);
|
||||
this.stream.off('drive_file_updated', this.onStreamDriveFileUpdated);
|
||||
this.stream.off('drive_folder_created', this.onStreamDriveFolderCreated);
|
||||
this.stream.off('drive_folder_updated', this.onStreamDriveFolderUpdated);
|
||||
this.connection.off('file_created', this.onStreamDriveFileCreated);
|
||||
this.connection.off('file_updated', this.onStreamDriveFileUpdated);
|
||||
this.connection.off('folder_created', this.onStreamDriveFolderCreated);
|
||||
this.connection.off('folder_updated', this.onStreamDriveFolderUpdated);
|
||||
this.driveStream.dispose(this.connectionId);
|
||||
});
|
||||
|
||||
this.onStreamDriveFileCreated = file => {
|
||||
|
||||
Reference in New Issue
Block a user