remove unused events
This commit is contained in:
parent
6d5387432d
commit
51707d55c6
|
@ -183,7 +183,6 @@ export default function App({ Component, err }) {
|
|||
const mlSearchConfig = await getMLSearchConfig();
|
||||
setMlSearchEnabled(mlSearchConfig.enabled);
|
||||
mlWorkManager.setMlSearchEnabled(mlSearchConfig.enabled);
|
||||
eventBus.emit(Events.APP_START);
|
||||
} catch (e) {
|
||||
logError(e, 'Error while loading mlSearchEnabled');
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ import { logoutUser } from 'services/userService';
|
|||
import { isFirstLogin } from 'utils/storage';
|
||||
import { AppContext } from 'pages/_app';
|
||||
import { logError } from 'utils/sentry';
|
||||
import { eventBus, Events } from 'services/events';
|
||||
import { KeyAttributes, User } from 'types/user';
|
||||
import FormContainer from 'components/Form/FormContainer';
|
||||
import FormPaper from 'components/Form/FormPaper';
|
||||
|
@ -81,13 +80,6 @@ export default function Credentials() {
|
|||
keyAttributes,
|
||||
key
|
||||
);
|
||||
// TODO: not required after reseting appContext on first login
|
||||
appContext.updateMlSearchEnabled(false);
|
||||
}
|
||||
try {
|
||||
eventBus.emit(Events.LOGIN);
|
||||
} catch (e) {
|
||||
logError(e, 'Error in login handlers');
|
||||
}
|
||||
await saveKeyInSessionStore(SESSION_KEYS.ENCRYPTION_KEY, key);
|
||||
await decryptAndStoreToken(key);
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
import { EventEmitter } from 'eventemitter3';
|
||||
|
||||
// When registering event handlers,
|
||||
// handle errors to avoid unhandled rejection or propogation to emit call
|
||||
// handle errors to avoid unhandled rejection or propagation to emit call
|
||||
|
||||
export enum Events {
|
||||
APP_START = 'appStart',
|
||||
LOGIN = 'login',
|
||||
LOGOUT = 'logout',
|
||||
FILE_UPLOADED = 'fileUploaded',
|
||||
LOCAL_FILES_UPDATED = 'localFilesUpdated',
|
||||
|
|
|
@ -58,8 +58,6 @@ class MLWorkManager {
|
|||
logQueueStats(this.liveSyncQueue, 'livesync');
|
||||
this.liveSyncQueue.on('idle', this.debouncedLiveSyncIdle, this);
|
||||
|
||||
// eventBus.on(Events.APP_START, this.appStartHandler, this);
|
||||
// eventBus.on(Events.LOGIN, this.startSyncJob, this);
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
eventBus.on(Events.FILE_UPLOADED, this.fileUploadedHandler, this);
|
||||
eventBus.on(
|
||||
|
@ -75,8 +73,6 @@ class MLWorkManager {
|
|||
|
||||
this.liveSyncQueue.removeAllListeners();
|
||||
|
||||
// eventBus.removeListener(Events.APP_START, this.appStartHandler, this);
|
||||
// eventBus.removeListener(Events.LOGIN, this.startSyncJob, this);
|
||||
eventBus.removeListener(
|
||||
Events.FILE_UPLOADED,
|
||||
// eslint-disable-next-line @typescript-eslint/unbound-method
|
||||
|
|
Loading…
Reference in a new issue