@@ -33,7 +33,9 @@ import PeerAvatarGalleryUI
3333import MapResourceToAvatarSizes
3434import AppBundle
3535import ContextUI
36+ #if ENABLE_WALLET
3637import WalletUI
38+ #endif
3739import PhoneNumberFormat
3840import AccountUtils
3941import AuthTransferUI
@@ -221,7 +223,9 @@ private indirect enum SettingsEntry: ItemListNodeEntry {
221223 case themes( PresentationTheme , UIImage ? , String )
222224 case language( PresentationTheme , UIImage ? , String , String )
223225 case passport( PresentationTheme , UIImage ? , String , String )
226+ #if ENABLE_WALLET
224227 case wallet( PresentationTheme , UIImage ? , String , String )
228+ #endif
225229 case watch( PresentationTheme , UIImage ? , String , String )
226230
227231 case askAQuestion( PresentationTheme , UIImage ? , String )
@@ -243,8 +247,12 @@ private indirect enum SettingsEntry: ItemListNodeEntry {
243247 return SettingsSection . media. rawValue
244248 case . notificationsAndSounds, . privacyAndSecurity, . dataAndStorage, . themes, . language, . contentStickers:
245249 return SettingsSection . generalSettings. rawValue
246- case . passport, . wallet , . watch :
250+ case . passport, . watch:
247251 return SettingsSection . advanced. rawValue
252+ #if ENABLE_WALLET
253+ case . wallet:
254+ return SettingsSection . advanced. rawValue
255+ #endif
248256 case . askAQuestion, . faq:
249257 return SettingsSection . help. rawValue
250258 }
@@ -290,8 +298,10 @@ private indirect enum SettingsEntry: ItemListNodeEntry {
290298 return 1012
291299 case . contentStickers:
292300 return 1013
301+ #if ENABLE_WALLET
293302 case . wallet:
294303 return 1014
304+ #endif
295305 case . passport:
296306 return 1015
297307 case . watch:
@@ -457,12 +467,14 @@ private indirect enum SettingsEntry: ItemListNodeEntry {
457467 } else {
458468 return false
459469 }
470+ #if ENABLE_WALLET
460471 case let . wallet( lhsTheme, lhsImage, lhsText, lhsValue) :
461472 if case let . wallet( rhsTheme, rhsImage, rhsText, rhsValue) = rhs, lhsTheme === rhsTheme, lhsImage === rhsImage, lhsText == rhsText, lhsValue == rhsValue {
462473 return true
463474 } else {
464475 return false
465476 }
477+ #endif
466478 case let . watch( lhsTheme, lhsImage, lhsText, lhsValue) :
467479 if case let . watch( rhsTheme, rhsImage, rhsText, rhsValue) = rhs, lhsTheme === rhsTheme, lhsImage === rhsImage, lhsText == rhsText, lhsValue == rhsValue {
468480 return true
@@ -596,10 +608,12 @@ private indirect enum SettingsEntry: ItemListNodeEntry {
596608 return ItemListDisclosureItem ( presentationData: presentationData, icon: image, title: text, label: value, sectionId: ItemListSectionId ( self . section) , style: . blocks, action: {
597609 arguments. openPassport ( )
598610 } )
611+ #if ENABLE_WALLET
599612 case let . wallet( theme, image, text, value) :
600613 return ItemListDisclosureItem ( presentationData: presentationData, icon: image, title: text, label: value, sectionId: ItemListSectionId ( self . section) , style: . blocks, action: {
601614 arguments. openWallet ( )
602615 } )
616+ #endif
603617 case let . watch( theme, image, text, value) :
604618 return ItemListDisclosureItem ( presentationData: presentationData, icon: image, title: text, label: value, sectionId: ItemListSectionId ( self . section) , style: . blocks, action: {
605619 arguments. openWatch ( )
@@ -685,9 +699,11 @@ private func settingsEntries(account: Account, presentationData: PresentationDat
685699 entries. append ( . language( presentationData. theme, PresentationResourcesSettings . language, presentationData. strings. Settings_AppLanguage, languageName. isEmpty ? presentationData. strings. Localization_LanguageName : languageName) )
686700 entries. append ( . contentStickers( presentationData. theme, PresentationResourcesSettings . stickers, presentationData. strings. ChatSettings_Stickers, unreadTrendingStickerPacks == 0 ? " " : " \( unreadTrendingStickerPacks) " , archivedPacks) )
687701
702+ #if ENABLE_WALLET
688703 if hasWallet {
689704 entries. append ( . wallet( presentationData. theme, PresentationResourcesSettings . wallet, " Gram Wallet " , " " ) )
690705 }
706+ #endif
691707 if hasPassport {
692708 entries. append ( . passport( presentationData. theme, PresentationResourcesSettings . passport, presentationData. strings. Settings_Passport, " " ) )
693709 }
@@ -989,13 +1005,15 @@ public func settingsController(context: AccountContext, accountManager: AccountM
9891005 pushControllerImpl ? ( SecureIdAuthController ( context: context, mode: . list) )
9901006 } )
9911007 } , openWallet: {
1008+ #if ENABLE_WALLET
9921009 let _ = ( contextValue. get ( )
9931010 |> deliverOnMainQueue
9941011 |> take ( 1 ) ) . start ( next: { context in
9951012 context. sharedContext. openWallet ( context: context, walletContext: . generic, present: { c in
9961013 pushControllerImpl ? ( c)
9971014 } )
9981015 } )
1016+ #endif
9991017 } , openWatch: {
10001018 let _ = ( contextValue. get ( )
10011019 |> deliverOnMainQueue
@@ -1252,11 +1270,14 @@ public func settingsController(context: AccountContext, accountManager: AccountM
12521270 }
12531271 )
12541272 )
1255-
1273+ #if ENABLE_WALLET
12561274 let hasWallet = contextValue. get ( )
12571275 |> mapToSignal { context in
12581276 return context. hasWalletAccess
12591277 }
1278+ #else
1279+ let hasWallet : Signal < Bool , NoError > = . single( false )
1280+ #endif
12601281
12611282 let hasPassport = ValuePromise < Bool > ( false )
12621283 let updatePassport : ( ) -> Void = {
0 commit comments