diff --git a/frontend/src/components/Home.vue b/frontend/src/components/Home.vue index 58de826..673134c 100644 --- a/frontend/src/components/Home.vue +++ b/frontend/src/components/Home.vue @@ -18,14 +18,18 @@ export default defineComponent({ }, data() { return { - imageSelectedId: -1 as number, - sure: false as boolean, + imageSelectedId: -1, + sure: false, timer: null as ReturnType | null, - open: false as boolean, + open: false, + editor: false } }, - mounted() { - this.imageSelectedId = this.images.keys().next().value; + created() { + if (this.$route.params.id) + this.imageSelectedId = parseInt(this.$route.params.id as string); + else + this.imageSelectedId = this.images.keys().next().value; }, watch: { images() { @@ -43,13 +47,11 @@ export default defineComponent({ this.sure = true; }, startTimer() { - if (this.timer !== null) { + if (this.timer !== null) clearTimeout(this.timer); - this.timer = null; - } this.timer = setTimeout(() => { - location.href = "/images/" + this.imageSelectedId; - }, 2500); + this.editor = !this.editor; + }, 1900); }, clearTimer() { if (this.timer !== null) { @@ -63,9 +65,9 @@ export default defineComponent({