Skip to content

Commit

Permalink
fix: 🗑️ hashCode won't work because proxy is not ready yet.
Browse files Browse the repository at this point in the history
  • Loading branch information
whizzzkid committed Feb 11, 2023
1 parent 680672c commit 4d234d2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/client/getUniqIdForGroupedIssues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ interface GetUniqIdForGroupedIssuesArgs extends Omit<DetailedViewGroup, 'items'>
items: Pick<IssueData, 'node_id'>[]
}

// Based on Java's hashCode implementation: https://stackoverflow.com/a/7616484/104380
const hashCode = str => [...str].reduce((hash, chr) => 0 | (31 * hash + chr.charCodeAt(0)), 0)

export default function getUniqIdForGroupedIssues (groupedIssues: GetUniqIdForGroupedIssuesArgs[]): string {
return groupedIssues.map((group) => {
const groupChildrenId = group.items.map((item) => {
Expand All @@ -16,7 +13,7 @@ export default function getUniqIdForGroupedIssues (groupedIssues: GetUniqIdForGr
} catch (e) {
console.error('Problem getting node_id for group item:', item)
console.error(e)
return hashCode(JSON.stringify(item));
return Date.now().toString() + Math.random().toString()
}
}).join('-')
return `${group.groupName}${groupChildrenId}`
Expand Down

0 comments on commit 4d234d2

Please sign in to comment.