Commit 82c6dd5e authored by Matthias Betz's avatar Matthias Betz
Browse files

fix conversion component remembering file

parent 906e6d49
...@@ -9,13 +9,13 @@ ...@@ -9,13 +9,13 @@
</VcsLabel> </VcsLabel>
</v-col> </v-col>
<v-col> <v-col>
<VcsFileInput id="fileInput" type="file" @change="onFileSelected" accept=".ifc" /> <VcsFileInput id="fileInput" type="file" @change="onFileSelected" accept=".ifc" v-show="true"/>
</v-col> </v-col>
</v-row> </v-row>
<v-row no-gutters class="justify-center"> <v-row no-gutters class="justify-center">
</v-row> </v-row>
<v-row no-gutters class="justify-center"> <v-row no-gutters class="justify-center">
<VcsFormButton id="convertBtn" @click="convert()" :disabled="disable"> Konvertieren </VcsFormButton> <VcsFormButton id="convertBtn" @click="convert()" :disabled="disable"> {{ disable ? "Konvertierung läuft" : "Konvertieren" }} </VcsFormButton>
</v-row> </v-row>
</v-container> </v-container>
</v-card> </v-card>
...@@ -90,20 +90,18 @@ export default { ...@@ -90,20 +90,18 @@ export default {
}); // returns a promise }); // returns a promise
let filename = pluginState.file.name.replace(/\.[^/.]+$/, "") + ".glb"; let filename = pluginState.file.name.replace(/\.[^/.]+$/, "") + ".glb";
disable.value = true; disable.value = true;
const convertBtn = document.getElementById("convertBtn");
convertBtn.innerHTML = " Konvertierung läuft ";
req.then(function (res) { req.then(function (res) {
disable.value = false; disable.value = false;
convertBtn.innerHTML = " Konvertieren ";
emit('close');
const geolocationString = res.headers.get('X-geolocation');
if (geolocationString) {
const geolocation = JSON.parse(geolocationString);
pluginState.geolocations[filename] = geolocation;
}
if (res.ok) { if (res.ok) {
pluginState.file = undefined;
// status code was 200-299 // status code was 200-299
emit('close');
const geolocationString = res.headers.get('X-geolocation');
if (geolocationString) {
const geolocation = JSON.parse(geolocationString);
pluginState.geolocations[filename] = geolocation;
}
let message = "Datei erfolgreich konvertiert."; let message = "Datei erfolgreich konvertiert.";
let timeout = 5000; let timeout = 5000;
if (geolocationString) { if (geolocationString) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment