Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

types #605

Merged
merged 2 commits into from
Apr 30, 2024
Merged

types #605

Show file tree
Hide file tree
Changes from all commits
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
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
Loading