Просмотр исходного кода

Cloud: clear cached settings if already logged-out at startup (#4264)

John Richmond 7 месяцев назад
Родитель
Сommit
900de7b401
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      packages/cloud/src/SettingsService.ts

+ 5 - 0
packages/cloud/src/SettingsService.ts

@@ -39,6 +39,11 @@ export class SettingsService {
 	public initialize(): void {
 	public initialize(): void {
 		this.loadCachedSettings()
 		this.loadCachedSettings()
 
 
+		// Clear cached settings if we have missed a log out.
+		if (this.authService.getState() == "logged-out" && this.settings) {
+			this.removeSettings()
+		}
+
 		this.authService.on("active-session", () => {
 		this.authService.on("active-session", () => {
 			this.timer.start()
 			this.timer.start()
 		})
 		})