Skip to content

Commit 6e06f1e

Browse files
feat(space-control): reduce Space Control workspace limit to 1 (#542)
1 parent 40c18b4 commit 6e06f1e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

FlashSpace/Features/SpaceControl/SpaceControl.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ enum SpaceControl {
146146
workspaces = workspaces.skipWithoutRunningApps()
147147
}
148148

149-
if workspaces.count < 2 {
150-
Alert.showOkAlert(title: "Space Control", message: "You need at least 2 workspaces to use Space Control.")
149+
if workspaces.isEmpty {
150+
Alert.showOkAlert(title: "Space Control", message: "You need at least 1 workspace to use Space Control.")
151151
return false
152152
}
153153

FlashSpace/Features/SpaceControl/Views/SpaceControlViewModel.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ final class SpaceControlViewModel: ObservableObject {
140140
let width = screenFrame.width / CGFloat(numberOfColumns) - 120.0
141141
let height = screenFrame.height / CGFloat(numberOfRows) - 120.0
142142

143+
guard workspaces.count > 1 else {
144+
tileSize = CGSize(width: width / 2.0, height: height / 2.0)
145+
return
146+
}
147+
143148
let firstScreenshot = workspaces
144149
.lazy
145150
.compactMap { $0.screenshotData.flatMap(NSImage.init(data:)) }

0 commit comments

Comments
 (0)