mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
34 lines
1.4 KiB
Swift
34 lines
1.4 KiB
Swift
#if DEBUG
|
|
|
|
import Foundation
|
|
import TelegramCore
|
|
import Postbox
|
|
import SwiftSignalKit
|
|
import Display
|
|
import TelegramUI
|
|
|
|
func snapshotSettings(application: UIApplication, mainWindow: UIWindow, window: Window1, statusBarHost: StatusBarHost) {
|
|
let (account, accountManager) = snapshotEnvironment(application: application, mainWindow: mainWindow, statusBarHost: statusBarHost, theme: .night)
|
|
account.network.mockConnectionStatus = .online(proxyAddress: nil)
|
|
|
|
let _ = (account.postbox.transaction { transaction -> Void in
|
|
if let hole = account.postbox.seedConfiguration.initializeChatListWithHole.topLevel {
|
|
transaction.replaceChatListHole(groupId: nil, index: hole.index, hole: nil)
|
|
}
|
|
|
|
let accountPeer = TelegramUser(id: account.peerId, accessHash: nil, firstName: "Alena", lastName: "Shy", username: "alenashy", phone: "44321456789", photo: snapshotAvatar(account.postbox, 1), botInfo: nil, restrictionInfo: nil, flags: [])
|
|
transaction.updatePeersInternal([accountPeer], update: { _, updated in
|
|
return updated
|
|
})
|
|
}).start()
|
|
|
|
let rootController = TelegramRootController(account: account)
|
|
rootController.addRootControllers(showCallsTab: true)
|
|
window.viewController = rootController
|
|
rootController.rootTabController!.selectedIndex = 3
|
|
rootController.pushViewController(settingsController(account: account, accountManager: accountManager))
|
|
}
|
|
|
|
#endif
|
|
|