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

Code before:
                    action: 'Downloaded tar file',
                    label: this.tarName,
                    value: this.domainCount,
                });

                // Do tar generation
                this.tarContents().download(this.tarName);
            },
            copyTar() {
                // Analytics
                analytics({
                    category: 'Setup',
                    action: 'Copied base64 tar',
                    label: this.tarName,
                    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 = () => {
                    setTimeout(() => {
                        elm.textContent = this.$t('templates.setup.copyBase64');
                    }, 5000);
                };

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

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

                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}`,
                });

Review comment (suggestion):
👋 `setupCopy` gets used in a couple of different places, so we can't rely on hard-coding a specific string here.

What'd I recommend doing is in the `success` and `error` handlers below, making a copy of the original text there, then editing changing the text, and passing the original into this `resetText` function.

Code after:
                    action: 'Downloaded tar file',
                    label: this.tarName,
                    value: this.domainCount,
                });

                // Do tar generation
                this.tarContents().download(this.tarName);
            },
            copyTar() {
                // Analytics
                analytics({
                    category: 'Setup',
                    action: 'Copied base64 tar',
                    label: this.tarName,
                    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}`,