sindresorhus/ora

Run two spinners at the same

SNKYNinja opened this issue · 1 comments

I have a lavalink node connection, which connects to two nodes on startup and i have an event with this nodeConnection function, but since the connection runs synchronous it creates two spinners at the same. Is there any way I can run two spinners at the same time since currently it just kinda bugs out and edits the existing spinner on timeout

Code:

import { Node } from 'poru';
import ora from 'ora';
import chalk from 'chalk';

export const nodeConnect = async (node: Node) => {
    // console.log(chalk.redBright.bold(`[NODE]`) + ` ${node.name} has been loaded successfully`);
    const spinner = ora(`Connecting to ${node.name}`).start();
    setTimeout(() => {
        spinner.color = 'yellow';
        spinner.text = `${chalk.bold.yellow('[NODE]')} Connected to ${node.name}`;
    }, 10 * 1000);
};

Thank You

Duplicate of #116