58 lines
2.0 KiB
Swift
58 lines
2.0 KiB
Swift
import Foundation
|
|
|
|
/// Desktop parity: version constants and release notes.
|
|
/// Desktop equivalent: `app/version.ts` — `APP_VERSION`, `RELEASE_NOTICE`.
|
|
enum ReleaseNotes {
|
|
|
|
/// Current release notes entries, newest first.
|
|
/// Each entry contains a version string and either a `body` (free-form markdown)
|
|
/// or a `changes` list (auto-formatted as bullets).
|
|
static let entries: [Entry] = [
|
|
Entry(
|
|
version: appVersion,
|
|
body: """
|
|
|
|
**Пуш-уведомления**
|
|
Аватарки отправителей в системных пушах (Communication Notification). In-app баннер переделан 1-в-1 как в Telegram (glass-фон, жесты, анимации). Исправлен спам вибраций при входе. Desktop-suppression 30 сек.
|
|
"""
|
|
)
|
|
]
|
|
|
|
/// Current app version from bundle (matches desktop `APP_VERSION`).
|
|
static var appVersion: String {
|
|
Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "1.0.0"
|
|
}
|
|
|
|
/// Current build number from bundle.
|
|
static var buildNumber: String {
|
|
Bundle.main.infoDictionary?["CFBundleVersion"] as? String ?? "1"
|
|
}
|
|
|
|
/// Formatted release notice text for the current version (desktop parity: `RELEASE_NOTICE`).
|
|
/// Sent as a system message from the "Rosetta Updates" account.
|
|
static var releaseNoticeText: String {
|
|
guard let latest = entries.first else { return "" }
|
|
|
|
if let body = latest.body {
|
|
return "**Update v\(latest.version)**\n\n\(body)"
|
|
}
|
|
|
|
// Fallback: auto-format from changes array.
|
|
var lines = ["**Update v\(latest.version)**"]
|
|
for change in latest.changes {
|
|
lines.append("- \(change)")
|
|
}
|
|
return lines.joined(separator: "\n")
|
|
}
|
|
|
|
// MARK: - Entry
|
|
|
|
struct Entry: Identifiable {
|
|
let version: String
|
|
var changes: [String] = []
|
|
var body: String? = nil
|
|
|
|
var id: String { version }
|
|
}
|
|
}
|