How to create a timer in html which starts from same position each time when website is opened

I have written html code with a timer, but I need a script for it to countdown. I researched a lot in the internet and couldn’t find anything that could help me. Maybe someone has experience with this kind of thing here and can help me. I need this timer to start always at the same position 12 minutes 30 seconds when user enters the site it automatically starts going down. If site is refreshed the clock is counting down from the start point which is 12 minutes 30 seconds.

<div id="timer">
                                <h1 class="pt-5 text-2xl mb-3 font-extralight text-gray-200">Round Closing In</h1>
                                <div class="text-3xl text-center flex w-full">
                                    <div class="text-xl mr-1 font-extralight text-gray-200">in</div>
                                    <div class="w-24 mx-1 p-2 text-lrgreen rounded-lg">
                                        <div class="text-md font-mono leading-none inline-block" id="hours">0</div>
                                        <div class="font-mono uppercase text-sm leading-none">Hours</div>
                                    </div>
                                    <div class="w-24 mx-1 p-2 text-lrgreen rounded-lg">
                                        <div class="font-mono leading-none inline-block" id="minutes">12</div>
                                        <div class="font-mono uppercase text-sm leading-none">Minutes</div>
                                    </div>
                                    <div class="text-xl mx-1 font-extralight text-gray-200">and</div>
                                    <div class="w-24 mx-1 p-2 text-lrgreen rounded-lg">
                                        <div class="font-mono leading-none inline-block" id="seconds">30</div>
                                        <div class="font-mono uppercase text-sm leading-none">Seconds</div>
                                    </div>
                                </div>
                            </div>

Strange Gap Between Two Div Elements in React

I’m dealing with a weird issue right now. This is my first React website that I’ve developed and I’ve been able to figure stuff out on my own for the most part but I can’t seem to figure out where this weird gap is coming from. Image is attached below:

White Image Gap

I’m developing a personal site and the content in the upper half of the image is the image that the user is greeted with on landing, width and height are both set to 100%, but when you scroll down I didn’t want this gap to exist, I wanted to scroll straight into the About me section. I’ve tried to adjust the margin of each div to no avail (I also tried experimenting with. negative margins and only ever was able to create a weird overlap effect, which I didn’t want, picture of this overlap is here: Overlap), and I’ve also tried to change the background color of the body of the site to get rid of this white gap, but it gives every element of the site the gray-hue that I only wanted in the about me section and below (it also applied the hue to the landing page image, which is not what I wanted). I’ve attached the relevant HTML/CSS below, but please let me know if I can provide any more info. Any advice helps!

HTML:
<div className='home' id='home'>
// HTML for the landing page in here
</div>


<div className='color_setter'>        
// HTML for the about me section in here    
</div>

CSS:
.roof_pic { // styling for the landing page picture
  z-index: 1;
  width: 100%;
  height: auto;
  opacity: 0.4;
}

.about { // only styling related to the about me section
  /* text-align: center;
  display: grid; */
  margin: 100px;
}

Why `Body is unusable` error raised at an api call?

something wrong here:

    const response = await fetch(barionPaymentUrlString, {
        method: 'POST',
        body: JSON.stringify(p),
        headers: {
            'Content-Type': 'application/json',
        },
    })

    const data = await response.json()

I do not see anything wrong with this message / body:

{
    "PaymentWindow": "00:30:00",
    "PaymentRequestId": "TR-mx6y",
    "OrderNumber": "ON-mx6y",
    "Locale": "hu-HU",
    "Currency": "HUF",
    "FundingSources": [
        "All"
    ],
    "GuestCheckOut": true,
    "POSKey": "7996b5b9284f441b8f87ca2f8d220e46",
    "PaymentType": "Immediate",
    "RedirectUrl": "http://localhost:3000/1kw7/program/undefined",
    "Transactions": [
        {
            "POSTransactionId": "TR-1-1",
            "Payee": "[email protected]",
            "Total": "12000",
            "PayeeTransactions": [],
            "Items": [
                {
                    "Name": "Item",
                    "Description": "-",
                    "Quantity": 1,
                    "Unit": "db",
                    "UnitPrice": "12000",
                    "ItemTotal": "12000",
                    "SKU": "ENG-ADV-NTV"
                }
            ]
        }
    ],
    "CallbackUrl": "http://localhost:3000/api/finishPayment"
}

Firebase cloud functions with openai error deploying fuctions

when I tried deploy it give me this error :
Could not create or update Cloud Run service firstcall, Container Healthcheck failed. Revision ‘firstcall-00001-jel’ is not ready and cannot serve traffic. The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information.

Logs URL: https://console.cloud.google.com/logs/viewer?project=clouddeneme-6f208&resource=cloud_run_revision/service_name/firstcall/revision_name/firstcall-00001-jel&advancedFilter=resource.type%3D%22cloud_run_revision%22%0Aresource.labels.service_name%3D%22firstcall%22%0Aresource.labels.revision_name%3D%22firstcall-00001-jel%22
For more troubleshooting guidance, see https://cloud.google.com/run/docs/troubleshooting#container-failed-to-start

Functions deploy had errors with the following functions:
        firstCall(us-central1)
i  functions: cleaning up build files...
!  functions: Unhandled error cleaning up build images. This could result in a small monthly bill if not corrected. You can attempt to delete these images by redeploying or you can delete them manually at https://console.cloud.google.com/artifacts/docker/clouddeneme-6f208/us-central1/gcf-artifacts
Error: There was an error deploying functions

I tried this code its not deploying:

const {onRequest} = require("firebase-functions/v2/https");
const {initializeApp} = require("firebase-admin/app");
const {Configuration, OpenAIApi} = require("openai");
const configuration = new Configuration({
  apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
initializeApp();
exports.firstCall = onRequest({maxInstances: 10}, async (request, response) => {
  const chatCompletion = await openai.createChatCompletion({
    model: "gpt-3.5-turbo",
    messages: [{role: "user", content: "Hello world"}],
  });
  response.send(chatCompletion);
});

Can’t access fetched data in useEffect()

I’m creating a random quotes generator but there’s a problem. It just doesn’t generate a random quote at the beginning. Please correct me so that the generate random quote works at least one time when rendering

    const [quotes, setQuotes] = useState([]);
    const [randomQuote, setRandomQuote] = useState();

    useEffect(() => {
        async function fetchData() {
            await fetch(process.env.NEXT_PUBLIC_API_URL)
                .then(res => res.json())
                .then(data => setQuotes(data))
                .catch(err => console.error(err));
        }

        fetchData();
        console.log('from useEffect', quotes);
        generateRandomQuote();
    }, []);

    console.log('After useEffect(): ', quotes);

    const generateRandomQuote = () => {
        const randomIndex = Math.floor(Math.random() * quotes.length);
        const selectedQuote = quotes[randomIndex];
        setRandomQuote(selectedQuote);
    };

Why won’t my audio play if I click my button too fast?

I have something I am working on in HTML5 and javascript that is a clicker type game. It is very bland as of now, but I plan to add to it. I have a button and a counter, when you click the button the amount of “points” increases, and audio (should) play. It plays, but if you click again before the audio has ended, the audio won’t play. I want the audio to play on each click. Thanks.
Code:

const audio = new Audio ('btnClick.mp3')
            let counterDisplayElem = document.querySelector('.points');
            let counterPlusElem = document.querySelector('.bigButton');

            let count = 0;

            updateDisplay();

            counterPlusElem.addEventListener("click", () => {
                count = count + 1;
                updateDisplay();
                play()
            });

            function updateDisplay() {
                counterDisplayElem.innerHTML = "points : " + count;
            };

            // :family: :blue_car: :boom: ;)
            function play() {
               audio.play();
            }

I tried adding an audio playing function, and that to play when you clicked the button each time through an event listener. What happened was that the audio would play on click, but only once it had ended.

Microsoft Teams Adaptive Card in a Bot – How to get data the user has entered

I’m developing a MS teams application that mostly renders adaptive cards when some commands are entered by the user. Have used Teams Toolkit to create a Chat Command Bot.

One adaptive card renders a form that has an Submit action button at the bottom. No matter what I do, I can’t get the values the user has entered back to the Javascript application.

Here’s the code for the Adaptive card:

import { AdaptiveCards } from "@microsoft/adaptivecards-tools";
import { CardFactory, MessageFactory } from "botbuilder";


export class MyCommandHandler {
  triggerPatterns = "my-trigger";

  async handleCommandReceived(context, message) {
    // Message sender (full name)
    const sender = await context._activity.from.name;

    // Adaptive card with dynamic values
    const card = {
      "type": "AdaptiveCard",
      "body": [
        {
          "type": "TextBlock",
          "size": "Default",
          "weight": "Bolder",
          "text": "Header"
        },
        {
            "type": "Input.ChoiceSet",
            "choices": [
                {
                    "title": "Choice 1",
                    "value": "Choice 1"
                },
                {
                    "title": "Choice 2",
                    "value": "Choice 2"
                }
            ],
            "placeholder": "choose",
            "label": "Task:",
            "spacing": "Medium",
            "id": "dropdown-task",
            "isRequired": true,
            "value": "Choice 1"
        },
        {
            "type": "Input.Date",
            "label": "Date:",
            "isRequired": true,
            "id": "date"
        },
        {
            "type": "Input.Time",
            "label": "Time:",
            "isRequired": true,
            "id": "time",
            "value": "09:00"
        },
        {
            "type": "Input.ChoiceSet",
            "choices": [
                {
                    "title": "Choice 11",
                    "value": "Choice 11"
                },
                {
                    "title": "Choice 22",
                    "value": "Choice 22"
                }
            ],
            "placeholder": "Choose",
            "id": "dropdown-time-spent",
            "label": "Time spent:",
            "isRequired": true,
            "value": "Choice 11"
        },
        {
            "type": "Input.Text",
            "placeholder": "Placeholder text",
            "isRequired": true,
            "id": "description",
            "label": "Description:",
            "isMultiline": true,
            "value": "Description goes here"
        },
        {
            "type": "ActionSet",
            "actions": [
                {
                    "type": "Action.Submit",
                    "title": "Submit",
                    "style": "positive",
                    "id": "submit-btn"
                }
            ],
            "id": "action-set"
        }
      ],
      "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
      "version": "1.4"
    }

    const cardData = {
      title: "Command is added",
      body: "You have responded to the command"
    }
    const cardJson = AdaptiveCards.declare(card).render(cardData);
    return MessageFactory.attachment(CardFactory.adaptiveCard(cardJson));
  }
}

Is there another async function responsible for handling the submit event? I can’t find anything relevant in the official docs.

Thanks!

Cant scroll down on my webpage after adding banner images

I added a couple of banner images that change based on the nav button clicked but after I click the back button I cant scroll down on the webpage.

Here’s the code

  <!-- Banner -->
<div class="slideshow-container">
        <!-- Slides -->
        <div class="mySlides">
            <img src="assests/banner.webp" alt="Image 1">
        </div>

        <div class="mySlides">
            <img src="assests/banner2.webp" alt="Image 2">
        </div>

        <div class="mySlides">
            <img src="assests/banner3.webp" alt="Image 3">
        </div>

        <!-- Navigation arrows -->
        <a class="prev" onclick="plusSlides(-1)">&#10094;</a>
        <a class="next" onclick="plusSlides(1)">&#10095;</a>
    </div>

<script>
var slideIndex = 0;
    var slides = document.getElementsByClassName("mySlides");

    // Function to display the current slide
    function showSlide(n) {
        // Wrap around to the first slide if exceeding the number of slides
        slideIndex = (n + slides.length) % slides.length;

        // Hide all slides
        for (var i = 0; i < slides.length; i++) {
            slides[i].style.display = "none";
        }

        // Display the current slide
        slides[slideIndex].style.display = "block";
    }

    // Function to navigate to the previous or next slide
    function plusSlides(n) {
        showSlide(slideIndex + n);
    }

    // Display the first slide
    showSlide(slideIndex);
</script>

I want to be able to scroll down the webpage but instead it just keeps move the page up when I try to scroll down

Deobfuscating javascript blank spaces obfuscation code

I need help reading a source code that was obfuscated with blank spaces like so:

    ;const ᅟ︎ㅤ︃︋ = ᅟ︀ㅤ;
function ᅠ︀ᅠ︇️(ㅤ︆ㅤ︉︇, ᅠ︎ᅠ‍️, ᅠ︉ᅟᅟᅠ, ㅤ︆ㅤ︍︃, ᅠᅠᅟ‌︁) {
    const ᅠᅠᅟ︊︈ = (1013904223 + ((ㅤ︆ㅤ︉︇ + 39190) * 1664525)) % 4294967296;
    const ᅠㅤᅟᅠ︀ = (((0x0 << ((ᅠ︎ᅠ‍️ >> 0x18) & 0xff)) + (ᅠ︂︅ << ((ᅠ︎ᅠ‍️ >> 0) & 255))) + (24 << ((ᅠ︎ᅠ‍️ >> 020) & 255))) + (0X10 << ((ᅠ︎ᅠ‍️ >> 0X8) & 0Xff));
    const ㅤ︋ᅠᅠ︉ = (0X3c6EF35F + (1664525 * (ᅠ︉ᅟᅟᅠ + 60455))) % 0X100000000;
    const ᅠᅠᅠ︁︋ = (((17016 + ㅤ︆ㅤ︍︃) * 0x41c64E6D) + 0X3039) % 0x80000000;
    const ᅟᅠᅟ‍ᅟ = ((1664525 * (02647 + ᅠᅠᅟ‌︁)) + 1013904223) % 0X100000000;
    const ᅟ︅ㅤ︇︄ = ᅠᅟᅠ︃ᅠ(ᅠᅠᅟ︊︈, ᅠㅤᅟᅠ︀, ㅤ︋ᅠᅠ︉, ᅠᅠᅠ︁︋);
    const ᅠㅤㅤ︉‌ = ᅟᅟㅤ︌ᅠ(ᅟᅠᅟ‍ᅟ, ᅠᅠᅟ︊︈, ᅠㅤᅟᅠ︀);
    const ᅠ‌ᅠ︌︄ = ᅟ︅ㅤ︇︄ ^ 0X728f;
    return ᅠ‌ᅠ︌︄;
}

Just beign able to follow the variables while debugging would be my goal but I have no idea how to approach this problem.

No value returned after scraping data from website

I’m trying to use JS to scrape data from two websites, one being a player database and one being the league database for the NBA. I am able to obtain the TS% from the table from the player database, but it is not working for the league database.

const axios = require('axios');
const cheerio = require('cheerio');
const readline = require('readline');

const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});

rl.question('Enter the player's first name: ', firstName => {
rl.question('Enter the player's last name: ', lastName => {
const formattedLastName = lastName.trim();
const formattedFirstName = firstName.trim();

    const playerUrl = `https://www.basketball-reference.com/players/${formattedLastName.charAt(0)}/${formattedLastName.toLowerCase().slice(0, 5)}${formattedFirstName.toLowerCase().slice(0, 2)}01.html`;

    rl.question('Enter a year: ', year => {
      const previousYear = parseInt(year) - 1;
      const currentYear = parseInt(year);
      const leagueUrl = `https://www.basketball-    reference.com/leagues/NBA_${currentYear}_advanced.html`;

      axios.get(playerUrl)
        .then(playerResponse => {
          const $player = cheerio.load(playerResponse.data);
          const tableRows = $player('#div_advanced tbody tr');
          let playerTS;

          tableRows.each((index, element) => {
            const season = $player(element).find('th[data-stat="season"]').text();
            if (season.includes(previousYear) && season.includes('-')) {
              playerTS = $player(element).find('td[data-stat="ts_pct"]').text();
              return false; // Exit the loop
            }
          });

          axios.get(leagueUrl)
            .then(leagueResponse => {
              const $league = cheerio.load(leagueResponse.data);
              const leagueAverageTS = $league('#advanced-team tfoot td[data-  stat="ts_pct"]').text();

              const playerTSDiff = parseFloat(playerTS) - parseFloat(leagueAverageTS);
              console.log(`Player TS%: ${playerTS}`);
              console.log(`League Average TS%: ${leagueAverageTS}`);
              console.log(`Difference: ${playerTSDiff}`);
            })
            .catch(error => {
              console.log('An error occurred while fetching league data:', error);
            });
        })
        .catch(error => {
          console.log('An error occurred while fetching player data:', error);
        })
        .finally(() => {
          rl.close();
        });
    });

});
});

My code looks like this, and there isn’t any data returned for leagueAverageTS. If anyone can identify any issues with how I scraped data from the second website, that would be greatly appreciated.

Is there a way to convert all standard functions throughout my JavaScript app to arrow functions? [closed]

Suppose I have the following function:

function multiplyByTwo(input) {
    return input * 2;
}

and I wanted to convert this into an ES6 arrow function, such as:

const multiplyByTwo = (input) => input * 2;`

or

const multiplyByTwo = (input) => {
    return input * 2;
};

And these sorts of functions existed everywhere in the app, is there a way to traverse the entire app directory and convert the standard functions to arrow functions?

I tried creating a script that reads through each directory, but there were too many different nuances to account for in each of the standard functions.

Error retrieving users: TypeError: Cannot read properties of undefined (reading ‘getUsers’)

const sqlite3 = require('sqlite3').verbose();
const db = new sqlite3.Database('ticketDb.db');

async function getUsers(){
  return new Promise((resolve, reject) => {
    console.log('getUsers function is called');
    const qry = "SELECT * FROM User";
    db.all(qry, (err, res) => {
      if (err) {
        console.error('Error retrieving users:', err);
        reject(err);
      } else {
        console.log('Users data:', users); 
        resolve(res);
        
      }
    });
  });
};

console.log(getUsers())

module.exports = {
  getUsers: getUsers
};


dbmng.js file used for connection to database

const { app, BrowserWindow, ipcMain } = require('electron')
const dbmgr = require('../src/models/dbmgr');

const path = require('path')
const isDev = require('electron-is-dev')

require('@electron/remote/main').initialize()

function createWindow() {
    const win = new BrowserWindow({
        width:1200,
        height: 800,
        webPreferences: {
            preload: path.join(__dirname, '../src/preload.js'),
            enableRemoteModule: true,
            nodeIntegration: false,
            contextIsolation: true,
        }
    })

    win.loadURL(
        isDev
        ? 'http://localhost:3000'
        : `file://${path.join(__dirname, '../build/index.html')}`
        )

        ipcMain.on('getUsers', async (event) => {
            try {
              const users = await dbmgr.getUsers();
              event.reply('usersData', users);
            } catch (error) {
              console.error('Error retrieving users:', error);
              event.reply('usersData', []);
            }
          });
          
}

app.on('ready', createWindow)

this is main.js I dont know if it is good to put here this ipcmain fucntion I am new to electron trying to figure out ipcMain and contextBridge

import React, { useEffect, useState } from 'react';


const UserList = () => {
  const [users, setUsers] = useState([]);

  useEffect(() => {
    const fetchData = async () => {
      try {
        const data = await window.api.getUsers();
        setUsers(data);
      } catch (error) {
        console.error('Error retrieving users:', error);
      }
    };

    fetchData();
  }, []);

  return (
    <div id="users">
      {users.map((user) => (
        <div key={user.Id}>
          <span>{user.Email}</span>
          <span>{user.Password}</span>
        </div>
      ))}
    </div>
  );
};

export default UserList;

this is user-list.jsx and I have UserList-example rendering page

I am using electron like backend and for frontend react the database is sqlite, the error showing Error retrieving users: TypeError: Cannot read properties of undefined (reading ‘getUsers’),

based on error it could be anyting I tried so many options I could not find out, any help?

Tab selection with custom buttons

I have used the tabs in the bootstrap library for my site template.

Tabs work well without any issues. Only I want to connect a button to each tab in addition to clicking on it to go to the same tab by clicking on it.

The reason for doing this is that as the content increases, the user does not have to scroll up to see other tabs and go to other tabs through the buttons I placed at the end of the content.

Also, I don’t want the page to refresh by clicking the buttons. I want to go to the desired tab by clicking on each button.

    const triggerTabList = document.querySelectorAll('#myTab a')
    triggerTabList.forEach(triggerEl => {
      const tabTrigger = new bootstrap.Tab(triggerEl)

      triggerEl.addEventListener('click', event => {
        event.preventDefault()
        tabTrigger.show()
      })
    })

    document.querySelector('#myTab > li:first-child a').click()
.content_main {
  width: 650px;
  border: 1px solid #00000033;
  text-align: justify;
  margin: 0px 5px 10px 5px;
  padding: 20px;
  border-radius: 5px;
  line-height: 35px;
}

.nav_main .active {
  background: #6464ff;
  color: #fff;
}

.nav_main div .active {
  background: transparent;
  color: #000;
}

.content-tab {
  border: none;
}

.nav-tabs>li>a {
  background: #e2e2e2;
  border: 1px solid #00000033;
  box-shadow: 0 -2px 0 #2196f3;
  padding: 14px;
  color: #000;
  margin: 0px 15px 0px 5px;
  border-radius: 5px 5px 0 0;
}

.nav-tabs>li>a.comment {
  margin: 0;
  border-right: none;
  margin-right: 20px;
}

.nav-tabs>li>a.num-comment {
  border-left: none;
  padding-left: 5px;
  border-radius: 0 5px 0 0;
}

.content-tab {
  margin-top: 20px;
}

.content-tab a:hover {
  text-decoration: none;
}

.content-comment {
  margin-right: -10px;
}

.all_btn {
  text-decoration: none;
  color: #f7ff00;
  background: #3568ff;
  padding: 10px 10px 12px;
  margin-right: 20px;
  border-radius: 4px;
  font-weight: bold;
}

.all_btn:hover{
  text-decoration: none;
  color: #f7ff00;
  opacity: 0.8;
}
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"/>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="container">
    <div class="nav_main">
      <!-- Nav tabs -->
      <ul class="nav nav-tabs content-tab" role="tablist" id="myTab">
        <li role="presentation" class="content-desc"><a class="desc" href="#desc" aria-controls="desc" role="tab"
            data-toggle="tab">content</a></li>
        <li role="presentation" class="content-author"><a class="author" href="#author" aria-controls="author"
            role="tab" data-toggle="tab">author</a></li>
        <li role="presentation" class="content-comment"><a class="comment" href="#comment" aria-controls="comment"
            role="tab" data-toggle="tab">comment</a></li>
        <li role="presentation" class="content-tag"><a class="tag" href="#tag" aria-controls="tag" role="tab"
            data-toggle="tab">tag</a></li>
      </ul>
      <!-- Tab panes -->
      <div class="tab-content content_main">
        <div role="tabpanel" class="tab-pane active" id="desc">
          <p>
            Lorem ipsum, dolor sit amet consectetur adipisicing elit. Libero accusantium odit illum aspernatur sit,
            laudantium tempora non odio natus deserunt iure, at inventore laborum sequi asperiores porro culpa,
            repellendus earum tenetur nobis suscipit qui? Totam fugiat illo veniam omnis provident asperiores distinctio
            cumque ab aperiam eaque recusandae labore repellat quae iure corporis eos, quas molestiae a vel neque
            numquam, quibusdam ullam similique! Nemo placeat impedit repellat, perferendis praesentium quidem quis
            exercitationem? Laboriosam impedit atque, ut praesentium nulla placeat. Alias nobis facilis voluptas non ex
            corporis qui velit adipisci sit delectus aut incidunt ut voluptate exercitationem dolor, harum doloremque
            et, rerum sed aperiam nemo. Reiciendis, et aliquid beatae, voluptatum expedita optio fuga esse
            necessitatibus cumque enim qui inventore, veniam voluptates minima neque aliquam commodi dolores accusantium
            reprehenderit laboriosam ad assumenda natus libero. Praesentium, excepturi magnam. Accusamus excepturi iusto
            modi earum. Dolorum libero id, atque sequi rem at ducimus soluta minima quam earum, eum aliquam delectus
            nostrum nihil aliquid repellendus laboriosam, aut sit. Ea saepe distinctio voluptatibus, hic molestias,
            dolore illum, nostrum voluptatem a nisi velit nam deserunt. Doloribus, quaerat? Dignissimos amet expedita
            provident dolorem qui. Qui perferendis laudantium exercitationem sit soluta sequi eligendi, molestias,
            suscipit architecto, nemo sunt perspiciatis recusandae fugit!
          </p>
          <a id="btn_author" class="all_btn" href="#author"><span class="fas fa-pencil"></span> author</a>
          <a id="btn_comment" class="all_btn" href="#comment"><span class="fas fa-comment"></span> comment</a>
          <a id="btn_tag" class="all_btn" href="#tag"><span class="fas fa-tag"></span> tag</a>
        </div>
        <div role="tabpanel" class="tab-pane" id="author">
          <p>
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Mollitia, impedit!
          </p>
        </div>
        <div role="tabpanel" class="tab-pane" id="comment">
          <p>
            Lorem ipsum dolor sit amet consectetur adipisicing elit. Cupiditate fugit unde incidunt earum itaque aperiam
            nemo tenetur adipisci, ex hic.
          </p>
        </div>
        <div role="tabpanel" class="tab-pane" id="tag">
          <p>
            Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci dicta repellendus doloremque voluptatum
            omnis, impedit commodi nihil ad! Dolore, alias.
          </p>
        </div>
      </div>
    </div>

  </div>

API for getting currency exchange rates by date

I’m looking for an API which can exchange currencies by a specific date, any help is much appreciated! Best thing would be if there was no date limit, api call limit is fine.

Gonna use it to make automatic multi currency bookkeeping

I’ve tried looking everywhere.

Thanks!

Update Firebase user profile

I am trying to update my app, so that users can create profiles with more than just an email and password. But I keep on getting different errors for each method i try.
I want to start only with the ability to register a username

Heres my code regarding the registering methods:

import {Text, TextInput, View, Image, SafeAreaView, TouchableOpacity } from 'react-native'
import React, { useState, useLayoutEffect } from 'react'
import { authentication} from '../firebase-config';
import { createUserWithEmailAndPassword} from 'firebase/auth';
import { useTailwind } from 'tailwind-rn/dist';

const Registration = ({navigation}) => {
    const [email, setemail] = useState('')
    const [password, setpassword] = useState('')
    const [username, setusername] = useState('')

    const tailwind = useTailwind();

    useLayoutEffect(() => {
        const unsubscribe = authentication.onAuthStateChanged(user => {
            if (user) {
                navigation.navigate("onboarding")
            }
        })  
        return unsubscribe
    }, [])

    const Register = () =>{
    
        createUserWithEmailAndPassword(authentication, email, password)
        .then(authentication, userCredentials => {
            return userCredentials.user.updateProfile({
                displayName: username,
            })
        })
        .catch(error => {
            if (error.code === 'auth/email-already-in-use') {
                alert('That email address is already in use!');
            }
        
            if (error.code === 'auth/invalid-email') {
                alert('That email address is invalid!');
            }
        
            console.error(error);
            });
    }

I get errors as such:

[TypeError: undefined is not an object (evaluating ‘userCredentials.user.updateProfile’)]