Browse Source

fix: cache export

Signed-off-by: Wing-Kam Wong <wingkwong.code@gmail.com>
pull/1668/head
Wing-Kam Wong 3 years ago
parent
commit
7da6e5db34
  1. 6
      packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue

6
packages/nc-gui/components/project/spreadsheet/rowsXcDataTable.vue

@ -1497,13 +1497,13 @@ export default {
async exportCache() { async exportCache() {
try { try {
const data = (await this.$api.utils.cacheGet()) const data = (await this.$api.utils.cacheGet())
if (!data.length) { if (!data) {
this.$toast.info('Cache is empty').goAway(3000) this.$toast.info('Cache is empty').goAway(3000)
return return
} }
const blob = new Blob([JSON.stringify(data)], { type: 'text/plain;charset=utf-8' }) const blob = new Blob([JSON.stringify(data)], { type: 'text/plain;charset=utf-8' })
FileSaver.saveAs(blob, 'cache_exported.json') FileSaver.saveAs(blob, 'cache_exported.json')
this.$toast.info('Copied Cache to clipboard').goAway(3000) this.$toast.info('Exported Cache Successfully').goAway(3000)
} catch (e) { } catch (e) {
console.log(e) console.log(e)
this.$toast.error(e.message).goAway(3000) this.$toast.error(e.message).goAway(3000)
@ -1512,7 +1512,7 @@ export default {
async deleteCache() { async deleteCache() {
try { try {
await this.$api.utils.cacheDelete() await this.$api.utils.cacheDelete()
this.$toast.info('Deleted Cache').goAway(3000) this.$toast.info('Deleted Cache Successfully').goAway(3000)
} catch (e) { } catch (e) {
console.log(e) console.log(e)
this.$toast.error(e.message).goAway(3000) this.$toast.error(e.message).goAway(3000)

Loading…
Cancel
Save