mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
ea32e407a9
Updated the HomeVC, SettingsVC and GlobalSearch UI to use theming Removed the "fade view" gradients from the various screens Added a simple log to the PagedDatabaseObserver to make debugging easier Updated the FullConversationCell to also show the "read" state for messages Updated the read receipt icons to use SFSymbols directly Updated the PlaceholderIcon to use the PrimaryColour's as it's colour options
35 lines
1.3 KiB
Swift
35 lines
1.3 KiB
Swift
// Copyright © 2022 Rangeproof Pty Ltd. All rights reserved.
|
|
|
|
import Foundation
|
|
import GRDB
|
|
import SessionUtilitiesKit
|
|
|
|
/// This migration extracts an old theme preference from UserDefaults and saves it to the database as well as set the default for the other
|
|
/// theme preferences
|
|
enum _001_ThemePreferences: Migration {
|
|
static let target: TargetMigrations.Identifier = .uiKit
|
|
static let identifier: String = "ThemePreferences"
|
|
static let needsConfigSync: Bool = false
|
|
static let minExpectedRunDuration: TimeInterval = 0.1
|
|
|
|
static func migrate(_ db: Database) throws {
|
|
// Determine if the user was matching the system setting
|
|
let isMatchingSystemSetting: Bool = UserDefaults.standard.dictionaryRepresentation()
|
|
.keys
|
|
.contains("appMode")
|
|
|
|
// Set the default theme settings sccordingly
|
|
db[.themeMatchSystemDayNightCycle] = isMatchingSystemSetting
|
|
db[.theme] = (isMatchingSystemSetting ?
|
|
Theme.classicDark :
|
|
(UserDefaults.standard.integer(forKey: "appMode") == 0 ?
|
|
Theme.classicLight :
|
|
Theme.classicDark
|
|
)
|
|
)
|
|
db[.themePrimaryColor] = Theme.PrimaryColor.green
|
|
|
|
Storage.update(progress: 1, for: self, in: target) // In case this is the last migration
|
|
}
|
|
}
|