File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -204,6 +204,13 @@ async function getTotp(text: string) {
204204 if ( period ) {
205205 entryData [ hash ] . period = period ;
206206 }
207+ if (
208+ ( await EntryStorage . hasEncryptedEntry ( ) ) !==
209+ encryption . getEncryptionStatus ( )
210+ ) {
211+ chrome . tabs . sendMessage ( id , { action : "errorenc" } ) ;
212+ return ;
213+ }
207214 await EntryStorage . import ( encryption , entryData ) ;
208215 chrome . tabs . sendMessage ( id , { action : "added" , account } ) ;
209216 }
@@ -410,6 +417,10 @@ function setAutolock() {
410417 document . cookie = `passphrase="${ getCachedPassphrase ( ) } ${ getCookieExpiry ( ) } "` ;
411418 autolockTimeout = setTimeout ( ( ) => {
412419 cachedPassphrase = "" ;
420+ const id = contentTab . id ;
421+ if ( id ) {
422+ chrome . tabs . sendMessage ( id , { action : "stopCapture" } ) ;
423+ }
413424 } , Number ( localStorage . autolock ) * 60000 ) ;
414425 }
415426}
Original file line number Diff line number Diff line change @@ -14,6 +14,9 @@ if (!document.getElementById("__ga_grayLayout__")) {
1414 case "errorqr" :
1515 alert ( chrome . i18n . getMessage ( "errorqr" ) ) ;
1616 break ;
17+ case "errorenc" :
18+ alert ( chrome . i18n . getMessage ( "phrase_incorrect" ) ) ;
19+ break ;
1720 case "added" :
1821 alert ( message . account + chrome . i18n . getMessage ( "added" ) ) ;
1922 break ;
@@ -23,6 +26,17 @@ if (!document.getElementById("__ga_grayLayout__")) {
2326 case "pastecode" :
2427 pasteCode ( message . code ) ;
2528 break ;
29+ case "stopCapture" :
30+ const captureBox = document . getElementById ( "__ga_captureBox__" ) ;
31+ if ( captureBox ) {
32+ captureBox . style . display = "none" ;
33+ }
34+
35+ const grayLayout = document . getElementById ( "__ga_grayLayout__" ) ;
36+ if ( grayLayout ) {
37+ grayLayout . style . display = "none" ;
38+ }
39+ break ;
2640 default :
2741 // invalid command, ignore it
2842 break ;
You can’t perform that action at this time.
0 commit comments