Skip to content

Commit

Permalink
update for harmonia
Browse files Browse the repository at this point in the history
  • Loading branch information
hajonsoft committed Jan 14, 2025
1 parent 50db65d commit 18647b1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 24 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 17 additions & 18 deletions src/lib/kea.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const init = async () => {
}

global.user = await logInWithRefreshToken(token, apiKey);

// Get captcha key from realtime database
global.captchaKey = null;
const snapshot = await get(dbRef(database, "app-data/2captcha-key"));
Expand All @@ -75,18 +74,19 @@ const init = async () => {
}

// Gorilla is the package selection configuration. it looks like this
const gorillaSample = {
enabled: true,
accounts: ['tuTskCqZJBXtYWmPu7MufF','tuTskCqZJBXtYWmPu7MufF'],
goto: 'https://nusuk.hajj.sa/packages/selected/',
actions: [
{
selector: '#controlID',
wait: true,
click: false,
}
]
}
const gorillaSample = {
enabled: true,
accounts: ['tuTskCqZJBXtYWmPu7MufF', 'tuTskCqZJBXtYWmPu7MufF'],
goto: 'https://nusuk.hajj.sa/packages/selected/',
actions: [
{
selector: '#controlID',
wait: true,
click: false,
}
]
}

global.gorilla = null;
const gorillaSnapshot = await get(dbRef(database, "app-data/gorilla"));
if (gorillaSnapshot.exists()) {
Expand Down Expand Up @@ -253,8 +253,7 @@ const updatePassenger = async (accountId, passportNumber, payload) => {
snaps.docs.forEach(async (doc) => {
const data = doc.data();
console.log(
`🦜 Updating passenger ${data.givenNames.toUpperCase()} ${data.surname.toUpperCase()} in Group: ${
data.groupId
`🦜 Updating passenger ${data.givenNames.toUpperCase()} ${data.surname.toUpperCase()} in Group: ${data.groupId
}`,
{ payload }
);
Expand All @@ -271,9 +270,9 @@ const updateSubmission = async (payload) => {
};

const uploadImageToStorage = async (base64, destination) => {
const imageRef = ref(storage, destination);
const snapshot = await uploadString(imageRef, base64, "base64");
return await getDownloadURL(snapshot.ref);
const imageRef = ref(storage, destination);
const snapshot = await uploadString(imageRef, base64, "base64");
return await getDownloadURL(snapshot.ref);
};

module.exports = {
Expand Down
11 changes: 7 additions & 4 deletions src/nsh.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,10 +308,13 @@ async function pageContentHandler(currentConfig) {
await util.controller(page, currentConfig, data.travellers);
}
if (currentConfig.focus) {
await page.$eval(
currentConfig.focus,
(el) => el.scrollIntoView({ behavior: "smooth", block: "start" })
);
try {
await page.$eval(
currentConfig.focus,
(el) => el.scrollIntoView({ behavior: "smooth", block: "start" })
);
} catch {
}
}
switch (currentConfig.name) {
case "home":
Expand Down

0 comments on commit 18647b1

Please sign in to comment.