Repository: digitalocean/nginxconfig.io
File: src/nginxconfig/templates/setup.vue (Vue)

Code before:
                    value: this.domainCount,
                });

                // Do tar generation
                const path = `${this.$props.data.global.nginx.nginxConfigDirectory.computed}/${this.tarName}`;
                return this.tarContents().base64(path);
            },
            setupCopy(elm) {
                const resetText = (originalText) => {
                    setTimeout(() => {
                        elm.textContent = originalText;
                    }, 5000);
                };

                const clipboard = new ClipboardJS(elm, {
                    text: this.copyTar,
                });

                clipboard.on('success', e => {
                    const originalTextCopy = elm.textContent;
                    elm.textContent = this.$t('templates.app.copied');
                    e.clearSelection();
                    resetText(originalTextCopy);
                });

                clipboard.on('error', () => {
                    elm.textContent = 'Press Ctrl + C to copy';
                    resetText();
                });
            },
            showTab(target) {
                // Analytics
                analytics({
                    category: 'Setup',
                    action: 'Tab clicked',
                    label: `${this.$data.active}, ${target}`,
                });

                // Go!
                this.$data.active = target;
            },
            showPreviousTab() {
                // Analytics
                analytics({
                    category: 'Setup',
                    action: 'Back clicked',
                    label: `${this.$data.active}, ${this.previousTab}`,
                });

                // Go!
                this.$data.active = this.previousTab;

Review comment (suggestion):
This error handler also needs to store the original text so it can reset (I'm not too worried about translating this string for now, feel free to leave it untranslated in the files with a `// TODO: translate` comment)

Code after:
                    value: this.domainCount,
                });

                // Do tar generation
                const path = `${this.$props.data.global.nginx.nginxConfigDirectory.computed}/${this.tarName}`;
                return this.tarContents().base64(path);
            },
            setupCopy(elm) {
                const resetText = (originalText) => {
                    setTimeout(() => {
                        elm.textContent = originalText;
                    }, 5000);
                };

                const clipboard = new ClipboardJS(elm, {
                    text: this.copyTar,
                });

                clipboard.on('success', e => {
                    const originalTextCopy = elm.textContent;
                    elm.textContent = this.$t('templates.app.copied');
                    e.clearSelection();
                    resetText(originalTextCopy);
                });

                clipboard.on('error', () => {
                    const originalTextCopy = elm.textContent;
                    elm.textContent = 'Press Ctrl + C to copy';
                    resetText(originalTextCopy);
                });
            },
            showTab(target) {
                // Analytics
                analytics({
                    category: 'Setup',
                    action: 'Tab clicked',
                    label: `${this.$data.active}, ${target}`,
                });

                // Go!
                this.$data.active = target;
            },
            showPreviousTab() {
                // Analytics
                analytics({
                    category: 'Setup',
                    action: 'Back clicked',
                    label: `${this.$data.active}, ${this.previousTab}`,
                });

                // Go!