|
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>{{ |
24 | | - i18n.download_backup |
25 | | - }}</a-button-link> |
| 23 | + <button |
| 24 | + v-on:click="downloadBackUpOneLineOtpAuthFile()" |
| 25 | + v-if="!unsupportedAccounts && !isDataLinkSupported" |
| 26 | + class="button" |
| 27 | + > |
| 28 | + {{ i18n.download_backup }} |
| 29 | + </button> |
| 30 | + <a-button-link |
| 31 | + download="authenticator.json" |
| 32 | + :href="exportFile" |
| 33 | + v-if="unsupportedAccounts && isDataLinkSupported" |
| 34 | + >{{ i18n.download_backup }}</a-button-link |
| 35 | + > |
| 36 | + <button |
| 37 | + v-on:click="downloadBackUpExportFile()" |
| 38 | + v-if="unsupportedAccounts && !isDataLinkSupported" |
| 39 | + class="button" |
| 40 | + > |
| 41 | + {{ i18n.download_backup }} |
| 42 | + </button> |
26 | 43 | <a-button-link |
27 | 44 | download="authenticator.json" |
28 | 45 | :href="exportEncryptedFile" |
29 | | - v-if="encryption.getEncryptionStatus()" |
| 46 | + v-if="encryption.getEncryptionStatus() && isDataLinkSupported" |
30 | 47 | >{{ i18n.download_enc_backup }}</a-button-link |
31 | 48 | > |
| 49 | + <button |
| 50 | + v-on:click="downloadBackUpExportEncryptedFile()" |
| 51 | + v-if="encryption.getEncryptionStatus() && !isDataLinkSupported" |
| 52 | + class="button" |
| 53 | + > |
| 54 | + {{ i18n.download_enc_backup }} |
| 55 | + </button> |
32 | 56 | </div> |
33 | 57 | <a-button-link href="import.html">{{ i18n.import_backup }}</a-button-link> |
34 | 58 | <br /> |
35 | 59 | <!-- 3rd Party Backup Services --> |
36 | | - <div v-show="!backupDisabled"> |
| 60 | + <div v-show="!backupDisabled && isBackupServiceSupported"> |
37 | 61 | <div class="text"> |
38 | 62 | {{ i18n.storage_sync_info }} |
39 | 63 | </div> |
|
46 | 70 | </template> |
47 | 71 | <script lang="ts"> |
48 | 72 | import Vue from "vue"; |
| 73 | +import { isSafari } from "../../browser"; |
49 | 74 |
|
50 | 75 | export default Vue.extend({ |
51 | 76 | data: function () { |
@@ -73,6 +98,12 @@ export default Vue.extend({ |
73 | 98 | backupDisabled: function () { |
74 | 99 | return this.$store.getters["menu/storageArea"]; |
75 | 100 | }, |
| 101 | + isDataLinkSupported: function () { |
| 102 | + return !isSafari; |
| 103 | + }, |
| 104 | + isBackupServiceSupported: function () { |
| 105 | + return !isSafari; |
| 106 | + }, |
76 | 107 | }, |
77 | 108 | methods: { |
78 | 109 | showInfo(tab: string) { |
@@ -123,6 +154,22 @@ export default Vue.extend({ |
123 | 154 | return; |
124 | 155 | } |
125 | 156 | }, |
| 157 | + downloadBackUpOneLineOtpAuthFile() { |
| 158 | + const exportData = this.$store.state.accounts.exportData; |
| 159 | + const t = getOneLineOtpBackupFile(exportData); |
| 160 | + window.open(t); |
| 161 | + }, |
| 162 | + downloadBackUpExportFile() { |
| 163 | + const exportData = this.$store.state.accounts.exportData; |
| 164 | + const t = getBackupFile(exportData); |
| 165 | + window.open(t); |
| 166 | + }, |
| 167 | + downloadBackUpExportEncryptedFile() { |
| 168 | + const exportEncData = this.$store.state.accounts.exportEncData; |
| 169 | + const key = this.$store.state.accounts.key; |
| 170 | + const t = getBackupFile(exportEncData, key); |
| 171 | + window.open(t); |
| 172 | + }, |
126 | 173 | }, |
127 | 174 | }); |
128 | 175 |
|
|
0 commit comments