Skip to content

Commit a5ab37c

Browse files
refactor Home.vue to improve modal visibility and backup functionality
1 parent 6c22124 commit a5ab37c

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

src/views/Home.vue

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<b-nav-item @click="op = 'importKeys'; ddShow = false">
1515
<span class="text-white">{{ $t('import_from_google') }}</span>
1616
</b-nav-item>
17-
<!-- v-show="isElectron" -->
18-
<b-nav-item v-b-modal.modal-save-file>
17+
<!-- -->
18+
<b-nav-item v-show="isElectron" v-b-modal.modal-save-file>
1919
<span class="text-white">{{ $t('save_to_file') }}</span>
2020
</b-nav-item>
2121
</b-navbar-nav>
@@ -31,7 +31,8 @@
3131
</b-navbar>
3232

3333

34-
<div v-if="op!=='home'" style="position: relative; max-width: 800px; height: 100vh; background: rgba(0,0,0,0.5); z-index: 200000;">
34+
<div v-if="op!=='home'" style="max-width: 800px; height: 100vh; background: rgba(0,0,0,0.5); z-index: 200000;overflow: hidden; position: absolute; top:0; left:0; right:0; bottom:0;">
35+
3536
<div class="text-center text-white" style="margin-top: 20px;">
3637
<b-spinner variant="primary" label="Loading..."></b-spinner>
3738
</div>
@@ -163,6 +164,9 @@
163164
></b-form-input>
164165
</b-form-group>
165166
</form>
167+
<!--
168+
<a v-show="backup" id="download" download="smart2fa.json" :href="backup">Download</a>
169+
-->
166170
</b-modal>
167171
</div>
168172
</template>
@@ -210,6 +214,7 @@ export default {
210214
currentTime: 0,
211215
dateSeconds: 0,
212216
password: '',
217+
backup: '',
213218
}
214219
},
215220
computed: {
@@ -306,9 +311,10 @@ export default {
306311
let element = document.createElement('a');
307312
const data = await this.$store.dispatch('keys2fa/encryptKeys', this.password)
308313
let url = 'data:text/plain;charset=utf-8,' + encodeURIComponent(JSON.stringify(data));
314+
//this.backup = url;
309315
element.setAttribute('href', url);
310316
element.setAttribute('download', 'smart2fa.json');
311-
element.style.display = 'none';
317+
element.style.display = 'block';
312318
document.body.appendChild(element);
313319
element.click();
314320
document.body.removeChild(element);

0 commit comments

Comments
 (0)