fix: import collections from file - removed store commit
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<SmartModal v-if="show" @close="hideModal">
|
<SmartModal v-if="show" @close="hideModal">
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<div class="row-wrapper">
|
<div class="row-wrapper">
|
||||||
<h3 class="title">Export</h3>
|
<h3 class="title">{{ $t("import_export") }} {{ $t("collections") }}</h3>
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
v-if="mode != 'import_export'"
|
v-if="mode != 'import_export'"
|
||||||
@@ -177,7 +177,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { fb } from "~/helpers/fb"
|
import { fb } from "~/helpers/fb"
|
||||||
import { getSettingSubject } from "~/newstore/settings"
|
|
||||||
import * as teamUtils from "~/helpers/teams/utils"
|
import * as teamUtils from "~/helpers/teams/utils"
|
||||||
import {
|
import {
|
||||||
restCollections$,
|
restCollections$,
|
||||||
@@ -201,7 +200,6 @@ export default {
|
|||||||
},
|
},
|
||||||
subscriptions() {
|
subscriptions() {
|
||||||
return {
|
return {
|
||||||
SYNC_COLLECTIONS: getSettingSubject("syncCollections"),
|
|
||||||
myCollections: restCollections$,
|
myCollections: restCollections$,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -54,22 +54,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div slot="body" class="flex flex-col">
|
<div slot="body" class="flex flex-col">
|
||||||
<div class="flex flex-col items-start p-2">
|
<div class="flex flex-col items-start p-2">
|
||||||
<span
|
|
||||||
v-tooltip="{
|
|
||||||
content: !fb.currentUser
|
|
||||||
? $t('login_first')
|
|
||||||
: $t('replace_current'),
|
|
||||||
}"
|
|
||||||
>
|
|
||||||
<button
|
|
||||||
:disabled="!fb.currentUser"
|
|
||||||
class="icon"
|
|
||||||
@click="syncCollections"
|
|
||||||
>
|
|
||||||
<i class="material-icons">folder_shared</i>
|
|
||||||
<span>{{ $t("import_from_sync") }}</span>
|
|
||||||
</button>
|
|
||||||
</span>
|
|
||||||
<button
|
<button
|
||||||
v-tooltip="$t('replace_current')"
|
v-tooltip="$t('replace_current')"
|
||||||
class="icon"
|
class="icon"
|
||||||
@@ -134,6 +118,7 @@ import { fb } from "~/helpers/fb"
|
|||||||
import {
|
import {
|
||||||
graphqlCollections$,
|
graphqlCollections$,
|
||||||
setGraphqlCollections,
|
setGraphqlCollections,
|
||||||
|
appendGraphqlCollections,
|
||||||
} from "~/newstore/collections"
|
} from "~/newstore/collections"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -272,12 +257,8 @@ export default {
|
|||||||
this.failedImport()
|
this.failedImport()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.$store.commit("postwoman/importCollections", {
|
appendGraphqlCollections(collections)
|
||||||
data: collections,
|
|
||||||
flag: "graphql",
|
|
||||||
})
|
|
||||||
this.fileImported()
|
this.fileImported()
|
||||||
this.syncToFBCollections()
|
|
||||||
}
|
}
|
||||||
reader.readAsText(this.$refs.inputChooseFileToImportFrom.files[0])
|
reader.readAsText(this.$refs.inputChooseFileToImportFrom.files[0])
|
||||||
this.$refs.inputChooseFileToImportFrom.value = ""
|
this.$refs.inputChooseFileToImportFrom.value = ""
|
||||||
@@ -300,13 +281,6 @@ export default {
|
|||||||
icon: "done",
|
icon: "done",
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
syncCollections() {
|
|
||||||
this.$store.commit("postwoman/replaceCollections", {
|
|
||||||
data: fb.currentGraphqlCollections,
|
|
||||||
flag: "graphql",
|
|
||||||
})
|
|
||||||
this.fileImported()
|
|
||||||
},
|
|
||||||
fileImported() {
|
fileImported() {
|
||||||
this.$toast.info(this.$t("file_imported"), {
|
this.$toast.info(this.$t("file_imported"), {
|
||||||
icon: "folder_shared",
|
icon: "folder_shared",
|
||||||
|
|||||||
Reference in New Issue
Block a user