Skip to content

Commit

Permalink
BİSMİLLAHİRRAHMANİRRAHİM
Browse files Browse the repository at this point in the history
new khatms were breaking Header part(date) on page problem fixed inshaAllah
  • Loading branch information
Yusuf-YENICERI committed Jan 29, 2024
1 parent 94174d0 commit 91bed90
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/backend/APIs/firebase_api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,12 @@ class FirebaseAPI{
try {
let titleResult = await this.db.ref(`hatim/${this.extractKey()}/${subKey}/baslik`).get();
let descriptionResult = await this.db.ref(`hatim/${this.extractKey()}/${subKey}/description`).get();
let dateResult = await this.db.ref(`hatim/${this.extractKey()}/${subKey}/bitisTarihi`).get();

return {
title: titleResult.val(),
description: descriptionResult.val()
description: descriptionResult.val(),
date: dateResult.val()
}
} catch (error) {
return {data: undefined, error: error}
Expand Down
6 changes: 4 additions & 2 deletions src/components/cuz/Cuzler/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ const Question = ({ toggle }) => {

const [cuzlerHatimCardTitle, setCuzlerHatimCardTitle] = useState("")
const [cuzlerHatimCardDescription, setCuzlerHatimCardDescription] = useState("")
const [cuzlerHatimCardDate, setCuzlerHatimCardDate] = useState("")


/** CuzlerHatimCard End */
Expand Down Expand Up @@ -204,10 +205,11 @@ const Question = ({ toggle }) => {
return;
}

const {title, description} = await database.getTitleAndDescription({subKey: Object.values(result.khatmSubKeys)[0]});
const {title, description, date} = await database.getTitleAndDescription({subKey: Object.values(result.khatmSubKeys)[0]});

setCuzlerHatimCardTitle(title)
setCuzlerHatimCardDescription(description)
setCuzlerHatimCardDate(date)

// console.log(result.khatmSubKeys)
setKhatmSubKeys(result.khatmSubKeys);
Expand Down Expand Up @@ -530,7 +532,7 @@ const Question = ({ toggle }) => {
{
<CuzlerHatimCard header={cuzlerHatimCardTitle} description={cuzlerHatimCardDescription}
progress={totalPartsTaken/(allLanguage.length*30)*100} leftCuzs={allLanguage.length*30-totalPartsTaken}
duaLeftDays={allLanguage.filter(hatim=>hatim.subKey == currentKhatmSubKey)[0].bitisTarihi.split("-").reverse().join("/")}
duaLeftDays={cuzlerHatimCardDate.split("-").reverse().join("/")}
yesHandler={yesHandlerState} toggleYesHandler={toggleYesHandlerState}
noHandler={noHandlerState} toggleNoHandler={toggleNoHandlerState}

Expand Down

0 comments on commit 91bed90

Please sign in to comment.