Skip to content

Commit

Permalink
Merge pull request #605 from 1ifeworld/jawn/edits_for_type
Browse files Browse the repository at this point in the history
types
  • Loading branch information
jawndiego authored Apr 30, 2024
2 parents 95c1de9 + 4878d0a commit 71dd24c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions apps/site/components/client/ItemDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ function isAdminOrAdder({
channelRoleData,
itemAddedBy,
}: {
userRid: bigint
userRid: string
channelRoleData: ChannelRoles[]
itemAddedBy: bigint
}) {
// if targetRid was itemAdder, they have remove access
if (userRid === itemAddedBy) {
if (BigInt(userRid) === itemAddedBy) {
return true
}
// if targetRid wasnt itemAdder, loop through channel roles
Expand Down Expand Up @@ -88,7 +88,7 @@ export function ItemDropdown({
!add?.addedById
? false
: isAdminOrAdder({
userRid: targetUserId,
userRid: targetUserId.toString(),
channelRoleData: channel.roles.items,
itemAddedBy: add.addedById,
})
Expand Down
4 changes: 2 additions & 2 deletions apps/site/components/client/ItemDropzone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function hasAddAccess({
targetRid,
}: {
roleData: ChannelRoles[]
targetRid: bigint
targetRid: string
}) {
for (let i = 0; i < roleData.length; ++i) {
const rid = roleData[i].rid
Expand All @@ -53,7 +53,7 @@ export function ItemDropzone({ channel }: { channel: Channel }) {
? false
: hasAddAccess({
roleData: channel.roles.items,
targetRid: targetUserId,
targetRid: targetUserId.toString(),
})

const onDrop = async (acceptedFiles: File[]) => {
Expand Down
2 changes: 1 addition & 1 deletion apps/site/context/UserContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function UserContextComponent({ children }: { children: ReactNode }) {

if (!data) return

setUserId(data.records.id)
setUserId(BigInt(data.records.id))
setUsername(data.records.name)

const userChannels = await getUserChannels(data.records.id)
Expand Down

0 comments on commit 71dd24c

Please sign in to comment.