Skip to content

Commit e24d411

Browse files
committed
Various fixes
1 parent bae4591 commit e24d411

File tree

6 files changed

+404
-266
lines changed

6 files changed

+404
-266
lines changed

‎submodules/BrowserUI/Sources/BrowserWebContent.swift‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -446,16 +446,16 @@ final class BrowserWebContent: UIView, BrowserContent, WKNavigationDelegate, WKU
446446
return
447447
}
448448
switch authResult {
449-
case let .accept(allowWriteAccess, sharePhoneNumber):
449+
case let .accept(allowWriteAccess, sharePhoneNumber, matchCode):
450450
let signal: Signal<MessageActionUrlAuthResult, MessageActionUrlAuthError>
451451
if accountContext === context {
452-
signal = accountContext.engine.messages.acceptMessageActionUrlAuth(subject: subject, allowWriteAccess: allowWriteAccess, sharePhoneNumber: sharePhoneNumber)
452+
signal = accountContext.engine.messages.acceptMessageActionUrlAuth(subject: subject, allowWriteAccess: allowWriteAccess, sharePhoneNumber: sharePhoneNumber, matchCode: matchCode)
453453
} else {
454454
accountContext.account.shouldBeServiceTaskMaster.set(.single(.now))
455455
signal = accountContext.engine.messages.requestMessageActionUrlAuth(subject: subject)
456456
|> castError(MessageActionUrlAuthError.self)
457457
|> mapToSignal { result in
458-
return accountContext.engine.messages.acceptMessageActionUrlAuth(subject: subject, allowWriteAccess: allowWriteAccess, sharePhoneNumber: sharePhoneNumber)
458+
return accountContext.engine.messages.acceptMessageActionUrlAuth(subject: subject, allowWriteAccess: allowWriteAccess, sharePhoneNumber: sharePhoneNumber, matchCode: matchCode)
459459
} |> afterDisposed {
460460
accountContext.account.shouldBeServiceTaskMaster.set(.single(.never))
461461
}
@@ -497,6 +497,8 @@ final class BrowserWebContent: UIView, BrowserContent, WKNavigationDelegate, WKU
497497

498498
let _ = self.context.engine.messages.declineUrlAuth(url: url).start()
499499
self.webView.sendEvent(name: "oauth_result_failed", data: nil)
500+
501+
HapticFeedback().error()
500502
})
501503
case .decline:
502504
let _ = self.context.engine.messages.declineUrlAuth(url: url).start()

‎submodules/LegacyComponents/Sources/TGMediaPickerGalleryVideoItemView.m‎

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ - (instancetype)initWithFrame:(CGRect)frame
228228

229229
UIView *scrubberBackgroundView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, _headerView.frame.size.width, 64.0f)];
230230
scrubberBackgroundView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
231+
//scrubberBackgroundView.backgroundColor = [TGPhotoEditorInterfaceAssets toolbarTransparentBackgroundColor];
231232
[_scrubberPanelView addSubview:scrubberBackgroundView];
232233

233234
_scrubberView = [[TGMediaPickerGalleryVideoScrubber alloc] initWithFrame:CGRectMake(0.0f, _headerView.frame.size.height - 44.0f, _headerView.frame.size.width, 68.0f) cover:false];
@@ -440,44 +441,31 @@ - (void)setItem:(TGMediaPickerGalleryVideoItem *)item synchronously:(bool)synchr
440441
[_contentWrapperView addSubview:_entitiesView];
441442
}
442443

443-
444444
__weak TGMediaPickerGalleryVideoItemView *weakSelf = self;
445-
446-
SSignal *durationSignal = item.durationSignal;
447-
if (durationSignal != nil) {
448-
[_videoDurationVar set:[[[durationSignal deliverOn:[SQueue mainQueue]] catch:^SSignal *(__unused id error)
445+
[_videoDurationVar set:[[[item.durationSignal deliverOn:[SQueue mainQueue]] catch:^SSignal *(__unused id error)
446+
{
447+
__strong TGMediaPickerGalleryVideoItemView *strongSelf = weakSelf;
448+
if (strongSelf != nil && [error isKindOfClass:[NSNumber class]])
449+
[strongSelf _setDownloadRequired];
450+
451+
return nil;
452+
}] onNext:^(__unused id next)
453+
{
454+
__strong TGMediaPickerGalleryVideoItemView *strongSelf = weakSelf;
455+
if (strongSelf != nil)
449456
{
450-
__strong TGMediaPickerGalleryVideoItemView *strongSelf = weakSelf;
451-
if (strongSelf != nil && [error isKindOfClass:[NSNumber class]])
452-
[strongSelf _setDownloadRequired];
453-
454-
return nil;
455-
}] onNext:^(__unused id next)
456-
{
457-
__strong TGMediaPickerGalleryVideoItemView *strongSelf = weakSelf;
458-
if (strongSelf != nil)
459-
{
460-
strongSelf->_downloaded = true;
461-
if (strongSelf->_currentAvailabilityObserver != nil)
462-
strongSelf->_currentAvailabilityObserver(true);
463-
}
464-
}]];
465-
} else {
466-
_downloaded = true;
467-
if (_currentAvailabilityObserver != nil)
468-
_currentAvailabilityObserver(true);
469-
}
457+
strongSelf->_downloaded = true;
458+
if (strongSelf->_currentAvailabilityObserver != nil)
459+
strongSelf->_currentAvailabilityObserver(true);
460+
}
461+
}]];
470462

471463
SSignal *imageSignal = nil;
472464
if (item.asset != nil)
473465
{
474466
SSignal *assetSignal = [SSignal single:nil];
475467
if ([item.asset isKindOfClass:[TGMediaAsset class]])
476468
{
477-
if (((TGMediaAsset *)item.asset).type == TGMediaAssetPhotoType) {
478-
[_scrubberPanelView setHidden:true];
479-
}
480-
481469
assetSignal = [TGMediaAssetImageSignals imageForAsset:(TGMediaAsset *)item.asset imageType:(item.immediateThumbnailImage != nil) ? TGMediaAssetImageTypeScreen : TGMediaAssetImageTypeFastScreen size:CGSizeMake(1280, 1280)];
482470
}
483471
else
@@ -753,7 +741,7 @@ - (bool)usePhotoBehavior
753741
- (bool)itemIsLivePhoto
754742
{
755743
if ([self.item.asset isKindOfClass:[TGMediaAsset class]])
756-
return ((TGMediaAsset *)self.item.asset) ;
744+
return ((TGMediaAsset *)self.item.asset).subtypes & TGMediaAssetSubtypePhotoLive;
757745

758746
return false;
759747
}

‎submodules/TelegramUI/Components/AuthConfirmationScreen/BUILD‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ swift_library(
2222
"//submodules/TelegramPresentationData",
2323
"//submodules/AccountContext",
2424
"//submodules/TelegramUI/Components/ButtonComponent",
25+
"//submodules/TelegramUI/Components/PlainButtonComponent",
2526
"//submodules/TelegramUI/Components/GlassBarButtonComponent",
2627
"//submodules/Components/SheetComponent",
2728
"//submodules/PresentationDataUtils",

‎submodules/TelegramUI/Components/AuthConfirmationScreen/Sources/AccountSwitchComponent.swift‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,22 @@ final class AccountSwitchComponent: Component {
1515
let theme: PresentationTheme
1616
let peer: EnginePeer
1717
let canSwitch: Bool
18+
let isVisible: Bool
1819
let action: ((GlassContextExtractableContainer) -> Void)
1920

2021
init(
2122
context: AccountContext,
2223
theme: PresentationTheme,
2324
peer: EnginePeer,
2425
canSwitch: Bool,
26+
isVisible: Bool,
2527
action: @escaping ((GlassContextExtractableContainer) -> Void)
2628
) {
2729
self.context = context
2830
self.theme = theme
2931
self.peer = peer
3032
self.canSwitch = canSwitch
33+
self.isVisible = isVisible
3134
self.action = action
3235
}
3336

@@ -44,6 +47,9 @@ final class AccountSwitchComponent: Component {
4447
if lhs.canSwitch != rhs.canSwitch {
4548
return false
4649
}
50+
if lhs.isVisible != rhs.isVisible {
51+
return false
52+
}
4753
return true
4854
}
4955

@@ -116,7 +122,7 @@ final class AccountSwitchComponent: Component {
116122
transition.setAlpha(view: arrowView, alpha: component.canSwitch ? 1.0 : 0.0)
117123
}
118124

119-
self.backgroundView.update(size: size, cornerRadius: size.height * 0.5, isDark: component.theme.overallDarkAppearance, tintColor: .init(kind: .panel), isInteractive: component.canSwitch, transition: transition)
125+
self.backgroundView.update(size: size, cornerRadius: size.height * 0.5, isDark: component.theme.overallDarkAppearance, tintColor: .init(kind: .panel), isInteractive: component.canSwitch, isVisible: component.isVisible, transition: transition)
120126
transition.setFrame(view: self.backgroundView, frame: CGRect(origin: .zero, size: size))
121127
transition.setFrame(view: self.button, frame: CGRect(origin: .zero, size: size))
122128

0 commit comments

Comments
 (0)