File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ extern NSString *const kNSNotificationName_OtherUsersProfileDidChange;
1818
1919+ (instancetype )sharedManager ;
2020
21+ - (void )resetProfileStorage ;
22+
2123#pragma mark - Local Profile
2224
2325// These two methods should only be called from the main thread.
Original file line number Diff line number Diff line change @@ -830,6 +830,17 @@ - (NSString *)profileAvatarsDirPath
830830
831831// TODO: We may want to clean up this directory in the "orphan cleanup" logic.
832832
833+ - (void )resetProfileStorage
834+ {
835+ OWSAssert ([NSThread isMainThread ]);
836+
837+ NSError *error;
838+ [[NSFileManager defaultManager ] removeItemAtPath: [self profileAvatarsDirPath ] error: &error];
839+ if (error) {
840+ DDLogError (@" Failed to delete database: %@ " , error.description );
841+ }
842+ }
843+
833844#pragma mark - Notifications
834845
835846- (void )applicationDidBecomeActive : (NSNotification *)notification
Original file line number Diff line number Diff line change @@ -241,6 +241,7 @@ + (void)resetAppData {
241241 [DDLog flushLog ];
242242
243243 [[TSStorageManager sharedManager ] resetSignalStorage ];
244+ [[OWSProfileManager sharedManager ] resetProfileStorage ];
244245 [Environment.preferences clear ];
245246 [[UIApplication sharedApplication ] setApplicationIconBadgeNumber: 0 ];
246247
You can’t perform that action at this time.
0 commit comments