Hi Wix:) Kindly assist -
This happen only after adding the 'async' before the function. Even when deleting the 'async' still getting the same warning. If deleting the function & adding it againg without 'async', the warning is not there. But I need to async somehow...
Thanks a lot!
BUT it still not working.
Thanks a lot!!!
//calculating sum of swimmers targets
//===================================
export async function getTotalTarget() {
let total = 0;
let i;
wixData.query("Swimmers")
.find()
.then((results) => {
for (i = 0; i < results.items.length - 1; i++) {
total = total + results.items[i].goal;
}
$w("#textTotal").text = total;
return (total);
});
}
//calculating sum of donations
//============================
export async function getTotalRaised() {
let total = 0;
let i;
wixData.query("Donations")
.find()
.then((results) => {
for (i = 0; i < results.items.length - 1; i++) {
total = total + results.items[i].amount;
}
$w("#textAmount").text = total;
return (total);
});
}
//progress bar
//=============
export async function htmlProg_message( ) {
let raised = await getTotalRaised();
let target = await getTotalTarget();
.........
THANKS!!!
Looks to me like you removed the export.
It should be:
export async function htmlProg_message( ) { // ... }