File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
src/src/app/view/login-landing-desktop Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -64,11 +64,13 @@ export class LoginLandingDesktopComponent implements OnInit {
64
64
expiresUtc : oAuth . expiresUtc
65
65
} ;
66
66
67
- this . desktopData = JSON . stringify ( oAuth ) ;
68
- navigator . clipboard . writeText ( this . desktopData ) ;
69
- this . loading = false ;
70
- this . timer ?. unsubscribe ( ) ;
67
+ // DO NOT assign this.desktopData until AFTER you update the clipboard successfully.
68
+ // The absence of a value on this.desktopData is what tells the application we haven't logged in yet.
69
+ const json = JSON . stringify ( oAuth ) ;
70
+ navigator . clipboard . writeText ( json ) ;
71
+ this . desktopData = json ;
71
72
73
+ this . loading = false ;
72
74
this . timer = interval ( 1000 )
73
75
. subscribe ( {
74
76
next : _ => {
@@ -89,7 +91,7 @@ export class LoginLandingDesktopComponent implements OnInit {
89
91
try {
90
92
navigator . clipboard . readText ( ) . then ( text => {
91
93
// If the text matches what we put on the clipboard then we aren't signed in yet.
92
- if ( text === this . desktopData ) {
94
+ if ( undefined === this . desktopData || text === this . desktopData ) {
93
95
return ;
94
96
}
95
97
You can’t perform that action at this time.
0 commit comments