Skip to content

Commit 19b1777

Browse files
committed
Do one less restart when theme changes
1 parent 2c77732 commit 19b1777

File tree

4 files changed

+16
-20
lines changed

4 files changed

+16
-20
lines changed

macos/Podfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ PODS:
99
- hermes-engine/Pre-built (= 0.79.6)
1010
- hermes-engine/Pre-built (0.79.6)
1111
- HotKey (0.2.1)
12-
- MMKV (2.2.3):
13-
- MMKVCore (~> 2.2.3)
14-
- MMKVCore (2.2.3)
12+
- MMKV (2.2.4):
13+
- MMKVCore (~> 2.2.4)
14+
- MMKVCore (2.2.4)
1515
- RCT-Folly (2024.11.18.00):
1616
- boost
1717
- DoubleConversion
@@ -2096,8 +2096,8 @@ SPEC CHECKSUMS:
20962096
glog: ea1690290b2b90f923ffcce07436498f09b428ee
20972097
hermes-engine: 44bb6fe76a6eb400d3a992e2d0b21946ae999fa9
20982098
HotKey: 400beb7caa29054ea8d864c96f5ba7e5b4852277
2099-
MMKV: 941e8774da0e6fdf12c6b3fcc833ca687ae5a42d
2100-
MMKVCore: 6d5cc1bacce539f4c974985dfe646fb65a5d27d2
2099+
MMKV: 1a8e7dbce7f9cad02c52e1b1091d07bd843aefaf
2100+
MMKVCore: f2dd4c9befea04277a55e84e7812f930537993df
21012101
RCT-Folly: e8b53d8c0d2d9df4a6a8b0a368a1a91fc62a88cb
21022102
RCTDeprecation: c147f8912f768e5eedbc5f115b2b223d007d9fe3
21032103
RCTRequired: ae1e2d916a79190663b82b4cc5cddb1466bd788b

macos/sol-macOS/lib/SolNative.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,8 @@ class SolNative: RCTEventEmitter {
6767
_ resolve: @escaping RCTPromiseResolveBlock,
6868
rejecter reject: RCTPromiseRejectBlock
6969
) {
70-
do {
71-
let apps = try ApplicationSearcher.shared.getAllApplications()
70+
let apps = ApplicationSearcher.shared.getAllApplications()
7271
resolve(apps)
73-
} catch {
74-
reject(error.localizedDescription, error.localizedDescription, nil)
75-
}
7672
}
7773

7874
@objc func openFile(_ path: String) {

macos/sol-macOS/managers/HotKeyManager.swift

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ final class HotKeyManager {
1616
static public let shared = HotKeyManager()
1717

1818
public func setupKeyboardListeners() {
19-
settingsHotKey.keyDownHandler = {
19+
settingsHotKey.keyUpHandler = {
2020
SolEmitter.sharedInstance.onShow(target: "SETTINGS")
2121
}
22-
mainHotKey.keyDownHandler = PanelManager.shared.toggle
22+
mainHotKey.keyUpHandler = PanelManager.shared.toggle
23+
2324
NSEvent.addLocalMonitorForEvents(matching: .keyDown) {
2425
// 36 enter
2526
// 123 arrow left
@@ -136,7 +137,7 @@ final class HotKeyManager {
136137
}
137138

138139
func updateHotkeys(hotkeyMap: [String: String]) {
139-
hotkeys.forEach { $0.isPaused = true }
140+
print("Hotkeys being removed!")
140141
hotkeys.removeAll()
141142

142143
for (key, value) in hotkeyMap {
@@ -150,21 +151,21 @@ final class HotKeyManager {
150151
.trimmingCharacters(in: .whitespacesAndNewlines)
151152
{
152153
case "":
153-
modifiers.insert(.command)
154+
modifiers.insert(.command)
154155
case "cmd":
155-
modifiers.insert(.command)
156+
modifiers.insert(.command)
156157
case "command":
157158
modifiers.insert(.command)
158159
case "":
159-
modifiers.insert(.control)
160+
modifiers.insert(.control)
160161
case "control":
161162
modifiers.insert(.control)
162163
case "":
163-
modifiers.insert(.option)
164+
modifiers.insert(.option)
164165
case "option":
165166
modifiers.insert(.option)
166167
case "":
167-
modifiers.insert(.shift)
168+
modifiers.insert(.shift)
168169
case "shift":
169170
modifiers.insert(.shift)
170171
case "space":
@@ -187,7 +188,7 @@ final class HotKeyManager {
187188
guard let finalKey = keyValue else { continue }
188189
let hotKey = HotKey(key: finalKey, modifiers: modifiers)
189190

190-
hotKey.keyDownHandler = {
191+
hotKey.keyUpHandler = {
191192
SolEmitter.sharedInstance.onHotkey(id: key)
192193
}
193194
hotkeys.append(hotKey)

src/stores/items.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export function createBaseItems(store: IRootStore) {
2121
type: ItemType.CONFIGURATION,
2222
callback: () => {
2323
solNative.toggleDarkMode()
24-
solNative.restart()
2524
},
2625
},
2726
{

0 commit comments

Comments
 (0)