Skip to content

Commit

Permalink
Fix scroll behavior of boarding cards, fixes #1390
Browse files Browse the repository at this point in the history
  • Loading branch information
tmolitor-stud-tu committed Feb 5, 2025
1 parent d30351e commit 6b2a97e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Monal/Classes/BoardingCards.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,15 @@ struct OnboardingView: View {
.onAppear {
if UIDevice.current.userInterfaceIdiom != .pad {
//force portrait mode and lock ui there
UIDevice.current.setValue(UIInterfaceOrientation.portrait.rawValue, forKey: "orientation")
(UIApplication.shared.delegate as! MonalAppDelegate).orientationLock = .portrait
}
}
.onDisappear {
if UIDevice.current.userInterfaceIdiom != .pad {
//undo orientation lock
(UIApplication.shared.delegate as! MonalAppDelegate).orientationLock = .all
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion Monal/Classes/MonalAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, weak) ActiveChatsViewController* _Nullable activeChats;
@property (nonatomic, strong) MLVoIPProcessor* _Nullable voipProcessor;
@property (nonatomic, assign) MLAudioState audioState;
@property (nonatomic) UIInterfaceOrientationMask orientationLock;
@property (nonatomic, assign) UIInterfaceOrientationMask orientationLock;

-(UIViewController*) getTopViewController;
-(void) updateUnread;
Expand Down

0 comments on commit 6b2a97e

Please sign in to comment.