Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/common/components/BaniList/BaniList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import colors from "../../colors";
import { styles } from "../../../Settings/styles";

const BaniList = React.memo(({ data, onPress }) => {
console.log("rendering BaniList", data);
const fontSize = useSelector((state) => state.fontSize);
const fontFace = useSelector((state) => state.fontFace);
const isTransliteration = useSelector((state) => state.isTransliteration);
Expand Down Expand Up @@ -75,7 +76,7 @@ const BaniList = React.memo(({ data, onPress }) => {
style={!isPotrait && Platform.OS === "ios" && { marginLeft: 30 }}
data={data}
renderItem={renderBanis}
keyExtractor={(item) => item.gurmukhi}
keyExtractor={(item) => item.token}
/>
);
});
Expand Down
1 change: 1 addition & 0 deletions src/common/components/BaniList/baniOrderHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const extractBaniDetails = (baniItem) => {
id: baniItem.id,
gurmukhi: baniItem.gurmukhi,
translit: baniItem.translit,
token: baniItem.token,
};
};
const orderedBani = (baniList, baniOrder) => {
Expand Down
1 change: 1 addition & 0 deletions src/common/defaultBaniOrder.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ const defaultBaniOrder = {
{
gurmukhi: "22 vwrW",
translit: "22 varaa(n)",
token:"22vwrW"
Copy link

Copilot AI May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that the token property is properly delimited; if the following property is 'folder', a trailing comma might be required to maintain valid syntax.

Suggested change
token:"22vwrW"
token:"22vwrW",

Copilot uses AI. Check for mistakes.
folder: [
{
id: 86,
Expand Down
6 changes: 4 additions & 2 deletions src/database/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,23 @@ export const getBaniList = (language) => {
.then((db) => {
db.transaction((tx) => {
tx.executeSql(
"SELECT ID, Gurmukhi, Transliterations FROM Banis",
"SELECT ID, Gurmukhi, Token, Transliterations FROM Banis",
[],
(_tx, results) => {
const { rows } = results;
const count = rows.length;
const totalResults = [];
for (let i = 0; i < count; i += 1) {
const { ID, Gurmukhi, Transliterations } = rows.item(i);
const { ID, Gurmukhi, Transliterations, Token } = rows.item(i);

totalResults.push({
id: ID,
gurmukhi: Gurmukhi,
token: Token,
translit: getTranslitText(Transliterations, language),
});
}
console.log("Bani List", totalResults);
Copy link

Copilot AI May 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The debug logging statement may be unintentionally left in production code; consider removing it or wrapping it under a debug flag.

Suggested change
console.log("Bani List", totalResults);
if (process.env.DEBUG) {
logMessage("Bani List", totalResults);
}

Copilot uses AI. Check for mistakes.
resolve(totalResults);
},
(error) => {
Expand Down