Files
ichmagmaus111andClaude Opus 5.5 0622057a4f Ghostgram: open-source release
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 17:57:09 +01:00

29 lines
976 B
Swift

import Foundation
/// «Нужен перезапуск» without exit(0): remembers the value a `.requiresRestart` setting had in this
/// process before the menu first changed it. While the current value differs, the section shows
/// the restart footer; changing it back hides the footer again. Main thread only.
final class GGMenuRestartTracker {
static let shared = GGMenuRestartTracker()
private var launchValues: [String: Any] = [:]
private init() {
}
func noteBeforeChange<Value: Equatable>(key: String, launchValue: Value) {
assert(Thread.isMainThread)
if self.launchValues[key] == nil {
self.launchValues[key] = launchValue
}
}
func differsFromLaunch<Value: Equatable>(key: String, current: Value) -> Bool {
assert(Thread.isMainThread)
guard let launchValue = self.launchValues[key] as? Value else {
return false
}
return launchValue != current
}
}