File tree Expand file tree Collapse file tree 4 files changed +38
-3
lines changed
Expand file tree Collapse file tree 4 files changed +38
-3
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,15 @@ export default Vue.extend({
6060 computed ,
6161 methods: {
6262 showInfo(page : string ) {
63+ if (page === " AddMethodPage" ) {
64+ if (
65+ this .$store .state .menu .enforcePassword &&
66+ ! this .$store .state .accounts .encryption .getEncryptionStatus ()
67+ ) {
68+ page = " SetPasswordPage" ;
69+ }
70+ }
71+
6372 this .$store .commit (" style/showInfo" );
6473 this .$store .commit (" currentView/changeView" , page );
6574 },
Original file line number Diff line number Diff line change @@ -104,6 +104,14 @@ export default Vue.extend({
104104 return ;
105105 },
106106 async beginCapture() {
107+ if (
108+ this .$store .state .menu .enforcePassword &&
109+ ! this .$store .state .accounts .encryption .getEncryptionStatus ()
110+ ) {
111+ this .$store .commit (" style/showInfo" );
112+ this .$store .commit (" currentView/changeView" , " SetPasswordPage" );
113+ return ;
114+ }
107115 // Insert content script
108116 await new Promise (
109117 (resolve : () => void , reject : (reason : Error ) => void ) => {
Original file line number Diff line number Diff line change 1010 v-model =" confirm"
1111 v-on:keyup.enter =" changePassphrase()"
1212 />
13- <div id =" security-save" v-on:click =" changePassphrase()" >{{ i18n.ok }}</div >
14- <div id =" security-remove" v-on:click =" removePassphrase()" >
15- {{ i18n.remove }}
13+ <div v-show =" !enforcePassword" >
14+ <div id =" security-save" v-on:click =" changePassphrase()" >
15+ {{ i18n.ok }}
16+ </div >
17+ <div id =" security-remove" v-on:click =" removePassphrase()" >
18+ {{ i18n.remove }}
19+ </div >
20+ </div >
21+ <div
22+ class =" button-small"
23+ v-show =" enforcePassword"
24+ v-on:click =" changePassphrase()"
25+ >
26+ {{ i18n.ok }}
1627 </div >
1728 </div >
1829</template >
@@ -26,6 +37,11 @@ export default Vue.extend({
2637 confirm: " "
2738 };
2839 },
40+ computed: {
41+ enforcePassword : function () {
42+ return this .$store .state .menu .enforcePassword ;
43+ }
44+ },
2945 methods: {
3046 async removePassphrase() {
3147 await this .$store .dispatch (" accounts/changePassphrase" , " " );
Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ export class Menu implements IModule {
1111 autolock : Number ( localStorage . autolock ) || 0 ,
1212 backupDisabled : await ManagedStorage . get ( "disableBackup" ) ,
1313 exportDisabled : await ManagedStorage . get ( "disableExport" ) ,
14+ enforcePassword : await ManagedStorage . get ( "enforcePassword" ) ,
15+ enforceAutolock : await ManagedStorage . get ( "enforceAutolock" ) ,
1416 storageArea : await ManagedStorage . get ( "storageArea" ) ,
1517 feedbackURL : await ManagedStorage . get ( "feedbackURL" )
1618 } ,
You can’t perform that action at this time.
0 commit comments