Add optional sync between Macs with a shared 8-digit code
Notes and photos were stuck on one machine. A small Go/Postgres backend
stores each group's payload under a code that doubles as the shared
secret, so a second Mac just needs the code — no account or login.
Applying a remote change must not push it straight back, otherwise the
two Macs would bump the version back and forth forever, so payloads are
fingerprinted and identical ones are skipped.
💘 Generated with Crush
Assisted-by: Crush:kimi-k3
This commit is contained in:
@@ -19,6 +19,14 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
func applicationDidFinishLaunching(_ notification: Notification) {
|
||||
NSApp.setActivationPolicy(.accessory)
|
||||
|
||||
if CommandLine.arguments.contains("--sync-check") {
|
||||
Task { @MainActor in
|
||||
await SyncService.shared.runDiagnostic()
|
||||
NSApp.terminate(nil)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// Single instance: stale copies keep their hotkeys alive after an
|
||||
// update and eat the events meant for the new instance.
|
||||
let myPid = ProcessInfo.processInfo.processIdentifier
|
||||
@@ -43,6 +51,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
// Show the panel on launch so the app is discoverable (it has no Dock
|
||||
// icon and the menu bar icon can be hard to spot on a full bar).
|
||||
Task { @MainActor in
|
||||
SyncService.shared.start()
|
||||
PanelController.shared.show()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user