mirror of
https://github.com/funamitech/mastodon
synced 2024-12-15 07:09:03 +09:00
bceb45adda
Conflicts: - `app/javascript/entrypoints/common.js`: Upstream moved everything from `app/javascript/packs` to `app/javascript/entrypoints` while this file was a glitch-soc addition. Moved it like the rest. - `tsconfig.json`: Conflict due to glitch-soc's flavor. Updated like upstream. Also moved and updated the following files accordingly: - `app/javascript/flavours/vanilla/theme.yml` - `app/javascript/flavours/glitch/theme.yml` - everything in `app/javascript/flavours/glitch/packs`
43 lines
913 B
JavaScript
43 lines
913 B
JavaScript
import '@/entrypoints/public-path';
|
|
import axios from 'axios';
|
|
|
|
import ready from 'flavours/glitch/ready';
|
|
|
|
ready(() => {
|
|
setInterval(() => {
|
|
axios.get('/api/v1/emails/check_confirmation').then((response) => {
|
|
if (response.data) {
|
|
window.location = '/start';
|
|
}
|
|
}).catch(error => {
|
|
console.error(error);
|
|
});
|
|
}, 5000);
|
|
|
|
document.querySelectorAll('.timer-button').forEach(button => {
|
|
let counter = 30;
|
|
|
|
const container = document.createElement('span');
|
|
|
|
const updateCounter = () => {
|
|
container.innerText = ` (${counter})`;
|
|
};
|
|
|
|
updateCounter();
|
|
|
|
const countdown = setInterval(() => {
|
|
counter--;
|
|
|
|
if (counter === 0) {
|
|
button.disabled = false;
|
|
button.removeChild(container);
|
|
clearInterval(countdown);
|
|
} else {
|
|
updateCounter();
|
|
}
|
|
}, 1000);
|
|
|
|
button.appendChild(container);
|
|
});
|
|
});
|