Skip to content

Commit e2e1736

Browse files
committed
fix(classes): reset user data when removing congregation
1 parent 6995dc0 commit e2e1736

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/v3/classes/User.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,23 @@ export class User {
301301

302302
const profile = structuredClone(this.profile);
303303
profile.congregation = undefined;
304-
305304
await this.updateProfile(profile);
306305

306+
const settings = structuredClone(this.settings);
307+
settings.backup_automatic = '';
308+
settings.data_view = '';
309+
settings.hour_credits_enabled = '';
310+
settings.theme_follow_os_enabled = '';
311+
await this.updateSettings(settings);
312+
313+
await this.updateSessions([]);
314+
315+
await this.saveFieldServiceReports([]);
316+
317+
await this.saveBibleStudies([]);
318+
319+
await this.saveDelegatedFieldServiceReports([]);
320+
307321
if (cong) {
308322
await cong.reloadMembers();
309323
}

0 commit comments

Comments
 (0)