Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jfschwarz committed Sep 24, 2024
1 parent 746755e commit 2fcda5c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/app/app/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
// bsc,
polygon,
gnosis,
} from "@wagmi/core/chains" // cannot import from wagmi/chains because that one declares "use client;"
} from "wagmi/chains"

export const CHAINS = {
[mainnet.id]: {
Expand Down
11 changes: 6 additions & 5 deletions packages/app/components/permissions/PermissionsDiff/diff.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { PermissionCoerced, targetId, permissionId } from "zodiac-roles-sdk"
import { DiffFlag, PermissionsDiff, Preset } from "../types"
import { Preset } from "zodiac-roles-sdk/annotations"
import { DiffFlag, PermissionsDiff } from "../types"
import { comparePermissionIds } from "../groupPermissions"

export const diffPermissions = (
Expand Down Expand Up @@ -161,15 +162,15 @@ export const diffPresets = (

// 2) new path key in right: Hidden / Added
rightSorted.forEach((r) => {
if (!leftSorted.some((l) => l.pathKey === r.pathKey)) {
if (!leftSorted.some((l) => l.path === r.path)) {
diffLeft.set(r, { flag: DiffFlag.Hidden })
diffRight.set(r, { flag: DiffFlag.Added })
}
})

// 3) missing path key in right: Removed / Hidden
leftSorted.forEach((l) => {
if (!rightSorted.some((r) => r.pathKey === l.pathKey)) {
if (!rightSorted.some((r) => r.path === l.path)) {
diffLeft.set(l, { flag: DiffFlag.Removed })
diffRight.set(l, { flag: DiffFlag.Hidden })
}
Expand All @@ -182,7 +183,7 @@ export const diffPresets = (
if (diffLeft.has(l)) return

const r = rightSorted.find(
(r) => !diffRight.has(r) && r.pathKey === l.pathKey && r.uri !== l.uri
(r) => !diffRight.has(r) && r.path === l.path && r.uri !== l.uri
)

if (r) {
Expand Down Expand Up @@ -213,7 +214,7 @@ export const diffPresets = (
if (diffRight.has(r)) return

const l = leftSorted.find(
(l) => !diffLeft.has(l) && l.pathKey === r.pathKey && l.uri !== r.uri
(l) => !diffLeft.has(l) && l.path === r.path && l.uri !== r.uri
)

if (l) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Preset } from "zodiac-roles-sdk/annotations"
import Flex from "@/ui/Flex"
import { Preset } from "../types"
import classes from "./style.module.css"
import Anchor from "@/ui/Anchor"

Expand Down
4 changes: 2 additions & 2 deletions packages/app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "NodeNext",
"module": "ESNext",
"moduleResolution": "Bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
Expand Down

0 comments on commit 2fcda5c

Please sign in to comment.