mirror of
https://github.com/ente-io/ente.git
synced 2025-08-07 23:18:10 +00:00
Remove unused code path
This commit is contained in:
parent
b0b7ec5347
commit
f15851e6de
@ -15,7 +15,6 @@ import { safeDirectoryName, safeFileName } from "@/new/photos/utils/native-fs";
|
||||
import { writeStream } from "@/new/photos/utils/native-stream";
|
||||
import { wait } from "@/utils/promise";
|
||||
import { CustomError } from "@ente/shared/error";
|
||||
import { Events, eventBus } from "@ente/shared/events";
|
||||
import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
|
||||
import { formatDateTimeShort } from "@ente/shared/time/format";
|
||||
import type { User } from "@ente/shared/user/types";
|
||||
@ -177,42 +176,22 @@ class ExportService {
|
||||
}
|
||||
|
||||
enableContinuousExport() {
|
||||
try {
|
||||
if (this.continuousExportEventHandler) {
|
||||
log.info("continuous export already enabled");
|
||||
return;
|
||||
}
|
||||
log.info("enabling continuous export");
|
||||
this.continuousExportEventHandler = () => {
|
||||
this.scheduleExport({ resync: this.resyncOnce() });
|
||||
};
|
||||
this.continuousExportEventHandler();
|
||||
eventBus.addListener(
|
||||
Events.LOCAL_FILES_UPDATED,
|
||||
this.continuousExportEventHandler,
|
||||
);
|
||||
} catch (e) {
|
||||
log.error("failed to enableContinuousExport ", e);
|
||||
throw e;
|
||||
if (this.continuousExportEventHandler) {
|
||||
log.warn("Continuous export already enabled");
|
||||
return;
|
||||
}
|
||||
this.continuousExportEventHandler = () => {
|
||||
this.scheduleExport({ resync: this.resyncOnce() });
|
||||
};
|
||||
this.continuousExportEventHandler();
|
||||
}
|
||||
|
||||
disableContinuousExport() {
|
||||
try {
|
||||
if (!this.continuousExportEventHandler) {
|
||||
log.info("continuous export already disabled");
|
||||
return;
|
||||
}
|
||||
log.info("disabling continuous export");
|
||||
eventBus.removeListener(
|
||||
Events.LOCAL_FILES_UPDATED,
|
||||
this.continuousExportEventHandler,
|
||||
);
|
||||
this.continuousExportEventHandler = null;
|
||||
} catch (e) {
|
||||
log.error("failed to disableContinuousExport", e);
|
||||
throw e;
|
||||
if (!this.continuousExportEventHandler) {
|
||||
log.warn("Continuous export already disabled");
|
||||
return;
|
||||
}
|
||||
this.continuousExportEventHandler = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,12 +0,0 @@
|
||||
import { EventEmitter } from "eventemitter3";
|
||||
|
||||
// TODO: Remove me
|
||||
|
||||
// When registering event handlers,
|
||||
// handle errors to avoid unhandled rejection or propagation to emit call
|
||||
|
||||
export enum Events {
|
||||
LOCAL_FILES_UPDATED = "localFilesUpdated",
|
||||
}
|
||||
|
||||
export const eventBus = new EventEmitter<Events>();
|
Loading…
x
Reference in New Issue
Block a user