Skip to content

Commit

Permalink
🎨 Clean up code
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKai77 committed Oct 22, 2023
1 parent 9347eb2 commit edfd1a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Loop/Managers/LoopManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class LoopManager {

private func startTriggerDelayTimer(seconds: Float, handler: @escaping () -> Void) {
self.triggerDelayTimer = DispatchSource.makeTimerSource(queue: .main)
self.triggerDelayTimer!.schedule(deadline: .now() + .milliseconds(Int(seconds*1000)))
self.triggerDelayTimer!.schedule(deadline: .now() + .milliseconds(Int(seconds * 1000)))
self.triggerDelayTimer!.setEventHandler {
handler()
self.triggerDelayTimer = nil
Expand All @@ -65,8 +65,7 @@ class LoopManager {
}

private func currentWindowDirectionChanged(_ notification: Notification) {
if let newDirection = notification.userInfo?["direction"] as? WindowDirection,
let window = self.frontmostWindow {
if let newDirection = notification.userInfo?["direction"] as? WindowDirection {
if newDirection.cyclable {
self.currentResizingDirection = newDirection.nextCyclingDirection(from: self.currentResizingDirection)
Notification.Name.directionChanged.post(userInfo: ["direction": self.currentResizingDirection])
Expand Down
2 changes: 0 additions & 2 deletions Loop/Window Management/WindowDirection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//
// Created by Kai Azim on 2023-06-14.
//
// swiftlint:disable file_length

import SwiftUI
import Defaults
Expand Down Expand Up @@ -70,7 +69,6 @@ enum WindowDirection: CaseIterable, Identifiable {
static var verticalThirds: [WindowDirection] {
[.topThird, .topTwoThirds, .verticalCenterThird, .bottomTwoThirds, .bottomThird]
}

static var cyclable: [WindowDirection] {
[.cycleTop, .cycleBottom, .cycleLeft, .cycleRight]
}
Expand Down

0 comments on commit edfd1a4

Please sign in to comment.