refactor: update SNJS + eslint

This commit is contained in:
Baptiste Grob
2021-01-18 13:06:01 +01:00
parent f7f3b062fb
commit 27a68accdd
12 changed files with 272 additions and 384 deletions

View File

@@ -5,7 +5,6 @@ import { dateToLocalizedString, preventRefreshing } from '@/utils';
import {
ApplicationEvent,
SyncQueueStrategy,
ProtectedAction,
ContentType,
SNComponent,
SNTheme,
@@ -44,7 +43,7 @@ type DockShortcut = {
}
}
class FooterViewCtrl extends PureViewCtrl<{}, {
class FooterViewCtrl extends PureViewCtrl<unknown, {
outOfSync: boolean;
hasPasscode: boolean;
dataUpgradeAvailable: boolean;
@@ -207,7 +206,7 @@ class FooterViewCtrl extends PureViewCtrl<{}, {
case AppStateEvent.BeganBackupDownload:
statusService.setMessage("Saving local backup…");
break;
case AppStateEvent.EndedBackupDownload:
case AppStateEvent.EndedBackupDownload: {
const successMessage = "Successfully saved backup.";
const errorMessage = "Unable to save local backup."
statusService.setMessage(data.success ? successMessage : errorMessage);
@@ -222,6 +221,7 @@ class FooterViewCtrl extends PureViewCtrl<{}, {
}
}, twoSeconds);
break;
}
}
}
@@ -544,28 +544,9 @@ class FooterViewCtrl extends PureViewCtrl<{}, {
}
async selectRoom(room: SNComponent) {
const run = () => {
this.$timeout(() => {
this.roomShowState[room.uuid] = !this.roomShowState[room.uuid];
});
};
if (!this.roomShowState[room.uuid]) {
const requiresPrivilege = await this.application.privilegesService!
.actionRequiresPrivilege(
ProtectedAction.ManageExtensions
);
if (requiresPrivilege) {
this.application.presentPrivilegesModal(
ProtectedAction.ManageExtensions,
run
);
} else {
run();
}
} else {
run();
}
this.$timeout(() => {
this.roomShowState[room.uuid] = !this.roomShowState[room.uuid];
});
}
displayBetaDialog() {