|
17 | 17 | <a-button-link |
18 | 18 | download="authenticator.txt" |
19 | 19 | :href="exportOneLineOtpAuthFile" |
20 | | - v-if="!unsupportedAccounts" |
| 20 | + v-if="!unsupportedAccounts & isDataLinkSupported" |
21 | 21 | >{{ i18n.download_backup }}</a-button-link |
22 | 22 | > |
23 | | - <a-button-link download="authenticator.json" :href="exportFile" v-else>{{ |
| 23 | + <button v-on:click="downloadBackUpOneLineOtpAuthFile()" v-if="!unsupportedAccounts & !isDataLinkSupported" class="button"> |
| 24 | + {{ i18n.download_backup }} |
| 25 | + </button> |
| 26 | + <a-button-link download="authenticator.json" :href="exportFile" v-if="unsupportedAccounts & isDataLinkSupported">{{ |
24 | 27 | i18n.download_backup |
25 | 28 | }}</a-button-link> |
| 29 | + <button v-on:click="downloadBackUpExportFile()" v-if="unsupportedAccounts & !isDataLinkSupported" class="button">{{ |
| 30 | + i18n.download_backup |
| 31 | + }}</button> |
26 | 32 | <a-button-link |
27 | 33 | download="authenticator.json" |
28 | 34 | :href="exportEncryptedFile" |
29 | | - v-if="encryption.getEncryptionStatus()" |
| 35 | + v-if="encryption.getEncryptionStatus() & isDataLinkSupported" |
30 | 36 | >{{ i18n.download_enc_backup }}</a-button-link |
31 | 37 | > |
| 38 | + <button v-on:click="downloadBackUpExportEncryptedFile()" v-if="encryption.getEncryptionStatus() & !isDataLinkSupported" class="button"> |
| 39 | + {{ i18n.download_enc_backup }} |
| 40 | + </button> |
32 | 41 | </div> |
33 | 42 | <a-button-link href="import.html">{{ i18n.import_backup }}</a-button-link> |
34 | 43 | <br /> |
35 | 44 | <!-- 3rd Party Backup Services --> |
36 | | - <div v-show="!backupDisabled"> |
| 45 | + <div v-show="!backupDisabled & isBackupServiceSupported"> |
37 | 46 | <div class="text"> |
38 | 47 | {{ i18n.storage_sync_info }} |
39 | 48 | </div> |
|
46 | 55 | </template> |
47 | 56 | <script lang="ts"> |
48 | 57 | import Vue from "vue"; |
| 58 | +import { isSafari } from "../../browser"; |
49 | 59 |
|
50 | 60 | export default Vue.extend({ |
51 | 61 | data: function () { |
@@ -73,6 +83,12 @@ export default Vue.extend({ |
73 | 83 | backupDisabled: function () { |
74 | 84 | return this.$store.getters["menu/storageArea"]; |
75 | 85 | }, |
| 86 | + isDataLinkSupported: function () { |
| 87 | + return !isSafari; |
| 88 | + }, |
| 89 | + isBackupServiceSupported: function () { |
| 90 | + return !isSafari; |
| 91 | + } |
76 | 92 | }, |
77 | 93 | methods: { |
78 | 94 | showInfo(tab: string) { |
@@ -123,6 +139,22 @@ export default Vue.extend({ |
123 | 139 | return; |
124 | 140 | } |
125 | 141 | }, |
| 142 | + downloadBackUpOneLineOtpAuthFile() { |
| 143 | + const exportData = this.$store.state.accounts.exportData; |
| 144 | + const t = getOneLineOtpBackupFile(exportData); |
| 145 | + window.open(t); |
| 146 | + }, |
| 147 | + downloadBackUpExportFile() { |
| 148 | + const exportData = this.$store.state.accounts.exportData; |
| 149 | + const t = getBackupFile(exportData); |
| 150 | + window.open(t); |
| 151 | + }, |
| 152 | + downloadBackUpExportEncryptedFile() { |
| 153 | + const exportEncData = this.$store.state.accounts.exportEncData; |
| 154 | + const key = this.$store.state.accounts.key; |
| 155 | + const t = getBackupFile(exportEncData, key); |
| 156 | + window.open(t); |
| 157 | + } |
126 | 158 | }, |
127 | 159 | }); |
128 | 160 |
|
|
0 commit comments