@@ -11,6 +11,7 @@ let hasMountedBefore = false;
1111// instead of flashing the white loading splash. The component still kicks
1212// off a fresh fetch on mount; the loaders write back into both the
1313// component state and these slots so the next visit is also instant.
14+ import { registerPageCacheReset } from " ../cache" ;
1415import type { LegalIdDoc } from " ./components/LegalIdAccordion.svelte" ;
1516import type { SocialBindingDisplay } from " ./components/SocialBindingAccordion.svelte" ;
1617
@@ -23,6 +24,24 @@ let cachedSelfDocId: string | undefined;
2324let cachedSocialBindingCount = 0 ;
2425let cachedSocialBindingPreview: SocialBindingDisplay [] = [];
2526let hasEverLoaded = false ;
27+
28+ // All of the above is one user's identity, and none of it survives a logout:
29+ // that's a client-side nav, which never re-evaluates this module, so the next
30+ // user to onboard on this device would be shown the previous user's name,
31+ // legal ID and contacts until the first fetch lands. `hasMountedBefore` goes
32+ // with them — a fresh session should play the entrance animation again.
33+ registerPageCacheReset (() => {
34+ cachedUserData = undefined ;
35+ cachedEname = undefined ;
36+ cachedIsFake = undefined ;
37+ cachedLegalId = null ;
38+ cachedDisplayName = undefined ;
39+ cachedSelfDocId = undefined ;
40+ cachedSocialBindingCount = 0 ;
41+ cachedSocialBindingPreview = [];
42+ hasEverLoaded = false ;
43+ hasMountedBefore = false ;
44+ });
2645 </script >
2746
2847<script lang =" ts" >
0 commit comments