Merge branch 'develop' into ismail/5068_start_thread

This commit is contained in:
ismailgulek
2022-01-04 15:28:19 +03:00
120 changed files with 3411 additions and 648 deletions
+23 -21
View File
@@ -284,6 +284,8 @@ TableViewSectionsDelegate>
@property (nonatomic) BOOL isPreparingIdentityService;
@property (nonatomic, strong) ServiceTermsModalCoordinatorBridgePresenter *serviceTermsModalCoordinatorBridgePresenter;
@property (nonatomic) AnalyticsScreenTimer *screenTimer;
@end
@implementation SettingsViewController
@@ -316,6 +318,8 @@ TableViewSectionsDelegate>
isSavingInProgress = NO;
isResetPwdInProgress = NO;
is3PIDBindingInProgress = NO;
self.screenTimer = [[AnalyticsScreenTimer alloc] initWithScreen:AnalyticsScreenSettings];
}
- (void)updateSections
@@ -777,9 +781,6 @@ TableViewSectionsDelegate>
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
// Screen tracking
[[Analytics sharedInstance] trackScreen:@"Settings"];
// Refresh display
[self refreshSettings];
@@ -809,6 +810,8 @@ TableViewSectionsDelegate>
[self releasePushedViewController];
[self.settingsDiscoveryTableViewSection reload];
[self.screenTimer start];
}
- (void)viewWillDisappear:(BOOL)animated
@@ -852,6 +855,12 @@ TableViewSectionsDelegate>
}
}
- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
[self.screenTimer stop];
}
#pragma mark - Internal methods
- (void)pushViewController:(UIViewController*)viewController
@@ -2252,11 +2261,11 @@ TableViewSectionsDelegate>
{
MXKTableViewCellWithLabelAndSwitch* sendCrashReportCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath];
sendCrashReportCell.mxkLabel.text = [VectorL10n settingsSendCrashReport];
sendCrashReportCell.mxkSwitch.on = RiotSettings.shared.enableCrashReport;
sendCrashReportCell.mxkLabel.text = VectorL10n.settingsAnalyticsAndCrashData;
sendCrashReportCell.mxkSwitch.on = RiotSettings.shared.enableAnalytics;
sendCrashReportCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor;
sendCrashReportCell.mxkSwitch.enabled = YES;
[sendCrashReportCell.mxkSwitch addTarget:self action:@selector(toggleSendCrashReport:) forControlEvents:UIControlEventTouchUpInside];
[sendCrashReportCell.mxkSwitch addTarget:self action:@selector(toggleAnalytics:) forControlEvents:UIControlEventTouchUpInside];
cell = sendCrashReportCell;
}
@@ -3127,27 +3136,20 @@ TableViewSectionsDelegate>
[[MXKRoomDataSourceManager sharedManagerForMatrixSession:self.mainSession] reset];
}
- (void)toggleSendCrashReport:(id)sender
- (void)toggleAnalytics:(UISwitch *)sender
{
BOOL enable = RiotSettings.shared.enableCrashReport;
if (enable)
if (sender.isOn)
{
MXLogDebug(@"[SettingsViewController] disable automatic crash report and analytics sending");
RiotSettings.shared.enableCrashReport = NO;
[[Analytics sharedInstance] stop];
// Remove potential crash file.
[MXLogger deleteCrashLog];
MXLogDebug(@"[SettingsViewController] enable automatic crash report and analytics sending");
[Analytics.shared optInWith:self.mainSession];
}
else
{
MXLogDebug(@"[SettingsViewController] enable automatic crash report and analytics sending");
MXLogDebug(@"[SettingsViewController] disable automatic crash report and analytics sending");
[Analytics.shared optOut];
RiotSettings.shared.enableCrashReport = YES;
[[Analytics sharedInstance] start];
// Remove potential crash file.
[MXLogger deleteCrashLog];
}
}