Skip to content

Commit

Permalink
Fix servicemanager broken due to unbound this
Browse files Browse the repository at this point in the history
  • Loading branch information
Soopyboo32 committed Dec 29, 2024
1 parent d39dabe commit 6a54a66
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/services/ServiceManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default class ServiceManager {
setMeta(
transformer: (meta: BackgroundTaskMetadata) => BackgroundTaskMetadata,
) {
let taskList = [...this.getTaskList()];
let taskList = [...ServiceManager.manager.getTaskList()];
taskList[0] = {
...taskList[0],
meta: transformer(taskList[0].meta),
Expand All @@ -119,21 +119,21 @@ export default class ServiceManager {
async executeTask(task: QueuedBackgroundTask) {
switch (task.task.name) {
case 'IMPORT_EPUB':
return importEpub(task.task.data, this.setMeta);
return importEpub(task.task.data, this.setMeta.bind(this));
case 'UPDATE_LIBRARY':
return updateLibrary(task.task.data || {}, this.setMeta);
return updateLibrary(task.task.data || {}, this.setMeta.bind(this));
case 'DRIVE_BACKUP':
return createDriveBackup(task.task.data, this.setMeta);
return createDriveBackup(task.task.data, this.setMeta.bind(this));
case 'DRIVE_RESTORE':
return driveRestore(task.task.data, this.setMeta);
return driveRestore(task.task.data, this.setMeta.bind(this));
case 'SELF_HOST_BACKUP':
return createSelfHostBackup(task.task.data, this.setMeta);
return createSelfHostBackup(task.task.data, this.setMeta.bind(this));
case 'SELF_HOST_RESTORE':
return selfHostRestore(task.task.data, this.setMeta);
return selfHostRestore(task.task.data, this.setMeta.bind(this));
case 'MIGRATE_NOVEL':
return migrateNovel(task.task.data, this.setMeta);
return migrateNovel(task.task.data, this.setMeta.bind(this));
case 'DOWNLOAD_CHAPTER':
return downloadChapter(task.task.data, this.setMeta);
return downloadChapter(task.task.data, this.setMeta.bind(this));
default:
return;
}
Expand Down

0 comments on commit 6a54a66

Please sign in to comment.