Skip to content

Commit

Permalink
Removing unused imports
Browse files Browse the repository at this point in the history
  • Loading branch information
savioserra committed Mar 19, 2021
1 parent c73cc95 commit 6aa626e
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/ThemeScheduler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as moment from "moment";

import { ConfigurationTarget, workspace } from "vscode";
import ConfigurationManager, { MappingData } from "./ConfigurationManager";
import { maxBy } from "lodash";

Expand Down Expand Up @@ -33,7 +32,7 @@ export default class ThemeScheduler {
scheduleAll(mappings: MappingData[]) {
this.clear();

const millisecondsMap = mappings.map(mapping => {
const millisecondsMap = mappings.map((mapping) => {
const ms = this.getTimeMillisecondsOffset(mapping.time);
return { ms, mapping };
});
Expand All @@ -56,7 +55,7 @@ export default class ThemeScheduler {
)
.map(({ mapping }) => ({
ms: this.getTimeMillisecondsOffset(mapping.time, 1),
mapping
mapping,
}));

const todaySchedules = [lastScheduledMapping, ...toBeSchedule];
Expand All @@ -77,7 +76,7 @@ export default class ThemeScheduler {
originTask: NodeJS.Timeout
): Promise<void> {
await ConfigurationManager.switchTheme(theme);
this.pendingTasks = this.pendingTasks.filter(t => t !== originTask);
this.pendingTasks = this.pendingTasks.filter((t) => t !== originTask);

this.schedule({ theme, time }, ThemeScheduler.dayMs);
}
Expand All @@ -96,11 +95,7 @@ export default class ThemeScheduler {

const toBeSchedule = now
.clone()
.set({
hour: datetime.hour(),
minute: datetime.minute(),
second: datetime.second()
})
.set({ h: datetime.hour(), m: datetime.minute(), s: datetime.second() })
.add(daysOffset, "days");

return toBeSchedule.diff(now, "milliseconds");
Expand Down

0 comments on commit 6aa626e

Please sign in to comment.