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 {
6464 expiresUtc : oAuth . expiresUtc
6565 } ;
6666
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 ;
7172
73+ this . loading = false ;
7274 this . timer = interval ( 1000 )
7375 . subscribe ( {
7476 next : _ => {
@@ -89,7 +91,7 @@ export class LoginLandingDesktopComponent implements OnInit {
8991 try {
9092 navigator . clipboard . readText ( ) . then ( text => {
9193 // 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 ) {
9395 return ;
9496 }
9597
You can’t perform that action at this time.
0 commit comments