Add files via upload

This commit is contained in:
niubility000 2021-10-22 00:19:45 +08:00 committed by GitHub
parent 8d610fb61b
commit af4bd5bde3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -83,12 +83,18 @@ export default {
}); });
}; };
if (this.$route.path === this.dest) {
this.$store.commit("closeHovers");
action(false, true);
return;
}
let dstItems = (await api.fetch(this.dest)).items; let dstItems = (await api.fetch(this.dest)).items;
let conflict = upload.checkConflict(items, dstItems); let conflict = upload.checkConflict(items, dstItems);
let overwrite = false; let overwrite = false;
let rename = false; let rename = false;
window.sessionStorage.setItem('destDir', this.dest);
if (conflict) { if (conflict) {
this.$store.commit("showHover", { this.$store.commit("showHover", {
prompt: "replace-rename", prompt: "replace-rename",
@ -106,6 +112,7 @@ export default {
} }
action(overwrite, rename); action(overwrite, rename);
if (!conflict) { if (!conflict) {
this.$store.commit("closeHovers"); this.$store.commit("closeHovers");
return; return;

View File

@ -28,7 +28,6 @@
<button <button
class="button button--flat button--red" class="button button--flat button--red"
@click="(event) => showConfirm(event, 'overwrite')" @click="(event) => showConfirm(event, 'overwrite')"
:disabled="$route.path === dest"
:aria-label="$t('buttons.replace')" :aria-label="$t('buttons.replace')"
:title="$t('buttons.replace')" :title="$t('buttons.replace')"
> >
@ -43,11 +42,6 @@ import { mapState } from "vuex";
export default { export default {
name: "replace-rename", name: "replace-rename",
data() {
return {
dest: window.sessionStorage.getItem('destDir'),
};
},
computed: mapState(["showConfirm"]), computed: mapState(["showConfirm"]),
}; };
</script> </script>