@@ -258,14 +258,22 @@ private enum AccountInfoEntry : TableItemListNodeEntry {
258
258
return ShortPeerRowItem ( initialSize, peer: info. peer, account: info. account, height: 42 , photoSize: NSMakeSize ( 28 , 28 ) , titleStyle: ControlStyle ( font: . normal( . title) , foregroundColor: theme. colors. text, highlightColor: theme. colors. underSelectedColor) , borderType: [ . Right] , inset: NSEdgeInsets ( left: 12 , right: 12 ) , viewType: viewType, action: {
259
259
arguments. context. sharedContext. switchToAccount ( id: info. account. id, action: nil )
260
260
} , contextMenuItems: {
261
- return . single( [ ContextMenuItem ( strings ( ) . accountSettingsDeleteAccount, handler: {
261
+
262
+ var items : [ ContextMenuItem ] = [ ]
263
+
264
+ items. append ( ContextMenuItem ( " Open In Window " , handler: {
265
+ arguments. context. sharedContext. openAccount ( id: info. account. id)
266
+ } , itemImage: MenuAnimation . menu_open_profile. value) )
267
+
268
+ items. append ( ContextSeparatorItem ( ) )
269
+
270
+ items. append ( ContextMenuItem ( strings ( ) . accountSettingsDeleteAccount, handler: {
262
271
confirm ( for: arguments. context. window, information: strings ( ) . accountConfirmLogoutText, successHandler: { _ in
263
272
_ = logoutFromAccount ( id: info. account. id, accountManager: arguments. context. sharedContext. accountManager, alreadyLoggedOutRemotely: false ) . start ( )
264
273
} )
265
- } , itemMode: . destruct, itemImage: MenuAnimation . menu_delete. value) ,
266
- ContextMenuItem ( " Open In Separate Window " , handler: {
267
-
268
- } , itemMode: . destruct, itemImage: MenuAnimation . menu_delete. value) ] )
274
+ } , itemMode: . destruct, itemImage: MenuAnimation . menu_delete. value) )
275
+
276
+ return . single( items)
269
277
} , alwaysHighlight: true , badgeNode: GlobalBadgeNode ( info. account, sharedContext: arguments. context. sharedContext, getColor: { _ in theme. colors. accent } , sync: true ) , compactText: true )
270
278
case let . addAccount( _, viewType) :
271
279
return GeneralInteractedRowItem ( initialSize, stableId: stableId, name: strings ( ) . accountSettingsAddAccount, nameStyle: ControlStyle ( font: . normal( . title) , foregroundColor: theme. colors. accentIcon) , type: . none, viewType: viewType, action: {
@@ -286,7 +294,7 @@ private enum AccountInfoEntry : TableItemListNodeEntry {
286
294
}
287
295
message = message. trimmed
288
296
289
- showModal ( with: ShareModalController ( ShareLinkObject ( arguments. context, link: message) ) , for: mainWindow )
297
+ showModal ( with: ShareModalController ( ShareLinkObject ( arguments. context, link: message) ) , for: arguments . context . window )
290
298
} , pushController: { controller in
291
299
arguments. presentController ( controller, false )
292
300
} )
@@ -331,10 +339,10 @@ private enum AccountInfoEntry : TableItemListNodeEntry {
331
339
return GeneralInteractedRowItem ( initialSize, stableId: stableId, name: strings ( ) . accountSettingsFAQ, icon: theme. icons. settingsFaq, activeIcon: theme. icons. settingsFaqActive, type: . next, viewType: viewType, action: arguments. openFaq, border: [ BorderType . Right] , inset: NSEdgeInsets ( left: 12 , right: 12 ) )
332
340
case let . ask( _, viewType) :
333
341
return GeneralInteractedRowItem ( initialSize, stableId: stableId, name: strings ( ) . accountSettingsAskQuestion, icon: theme. icons. settingsAskQuestion, activeIcon: theme. icons. settingsAskQuestionActive, type: . next, viewType: viewType, action: {
334
- confirm ( for: mainWindow , information: strings ( ) . accountConfirmAskQuestion, thridTitle: strings ( ) . accountConfirmGoToFaq, successHandler: { result in
342
+ confirm ( for: arguments . context . window , information: strings ( ) . accountConfirmAskQuestion, thridTitle: strings ( ) . accountConfirmGoToFaq, successHandler: { result in
335
343
switch result {
336
344
case . basic:
337
- _ = showModalProgress ( signal: arguments. context. engine. peers. supportPeerId ( ) , for: mainWindow ) . start ( next: { peerId in
345
+ _ = showModalProgress ( signal: arguments. context. engine. peers. supportPeerId ( ) , for: arguments . context . window ) . start ( next: { peerId in
338
346
if let peerId = peerId {
339
347
arguments. presentController ( ChatController ( context: arguments. context, chatLocation: . peer( peerId) ) , true )
340
348
}
@@ -395,13 +403,16 @@ private func accountInfoEntries(peerView:PeerView, context: AccountContext, acco
395
403
entries. append ( . whiteSpace( index: index, height: 20 ) )
396
404
index += 1
397
405
398
- for account in accounts {
399
- if account. account. id != context. account. id {
400
- entries. append ( . accountRecord( index: index, viewType: . singleItem, info: account) )
401
- index += 1
406
+ if !context. isSupport {
407
+ for account in accounts {
408
+ if account. account. id != context. account. id {
409
+ entries. append ( . accountRecord( index: index, viewType: . singleItem, info: account) )
410
+ index += 1
411
+ }
402
412
}
403
413
}
404
- if accounts. count < 3 {
414
+
415
+ if accounts. count < 3 , !context. isSupport {
405
416
entries. append ( . addAccount( index: index, viewType: . singleItem) )
406
417
index += 1
407
418
}
@@ -445,7 +456,7 @@ private func accountInfoEntries(peerView:PeerView, context: AccountContext, acco
445
456
index += 1
446
457
}
447
458
448
- if let state = appUpdateState {
459
+ if let state = appUpdateState, !context . isSupport {
449
460
entries. append ( . update( index: index, viewType: . singleItem, state: AnyUpdateStateEquatable ( any: state) ) )
450
461
index += 1
451
462
}
@@ -493,7 +504,7 @@ class LayoutAccountController : TableViewController {
493
504
private var searchController : InputDataController ?
494
505
private let searchState : ValuePromise < SearchState > = ValuePromise ( ignoreRepeated: true )
495
506
var navigation : NavigationViewController ? {
496
- return context. sharedContext . bindings. rootNavigation ( )
507
+ return context. bindings. rootNavigation ( )
497
508
}
498
509
499
510
override func viewDidResized( _ size: NSSize ) {
@@ -834,7 +845,7 @@ class LayoutAccountController : TableViewController {
834
845
}
835
846
836
847
if let currentEvent = NSApp . currentEvent, currentEvent. clickCount == 5 {
837
- context. sharedContext . bindings. rootNavigation ( ) . push ( DeveloperViewController ( context: context) )
848
+ context. bindings. rootNavigation ( ) . push ( DeveloperViewController ( context: context) )
838
849
}
839
850
840
851
genericView. scroll ( to: . up( true ) )
0 commit comments