Skip to content

Commit

Permalink
fix: disable goodid for minipay, fix: latest news not loading on post…
Browse files Browse the repository at this point in the history
…claim screen
  • Loading branch information
L03TJ3 committed Jan 22, 2025
1 parent d04c977 commit 387d31d
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@
},
"dependencies": {
"@babel/runtime": "^7.18.9",
"@gooddollar/good-design": "0.4.1-beta.0be3b9e7",
"@gooddollar/good-design": "0.4.1-beta.a4fdd345",
"@gooddollar/goodprotocol": "^2.0.24",
"@gooddollar/web3sdk": "^0.1.42",
"@gooddollar/web3sdk-v2": "0.4.1-beta.0be3b9e7",
"@gooddollar/web3sdk-v2": "0.4.1-beta.a4fdd345",
"@headlessui/react": "1.5.0",
"@lingui/format-json": "^4.0.0",
"@lingui/macro": "^4.0.0",
Expand Down
4 changes: 3 additions & 1 deletion src/pages/gd/Claim/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ const Claim = () => {
const [, payload] = useFeatureFlagWithPayload('goodid')
const { enabled = false, whitelist } = payload ?? {}
const [goodIdEnabled, setGoodIdEnabled] = useState<boolean | undefined>(false)
const { ethereum } = window
const isMiniPay = ethereum?.isMiniPay
//todo: add country check, but not required for initial UAT

useEffect(() => {
Expand All @@ -21,7 +23,7 @@ const Claim = () => {

if (payload === undefined) return <Spinner variant="page-loader" size="lg" />

return goodIdEnabled ? <NewClaim /> : <OldClaim />
return goodIdEnabled && !isMiniPay ? <NewClaim /> : <OldClaim />
}

export default Claim
5 changes: 4 additions & 1 deletion src/pages/gd/GoodId/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const GoodId = () => {
const [skipSegmentation, setSkipSegmentation] = useState<boolean | undefined>(false)
const [, payload] = useFeatureFlagWithPayload('goodid')
const { enabled = false, whitelist = undefined, countries = '' } = payload ?? {}
const { ethereum } = window
const isMiniPay = ethereum?.isMiniPay

const [isUpgraded] = usePromise(async () => {
if (isEmpty(certificateSubjects) && isWhitelisted !== undefined) {
Expand All @@ -44,10 +46,11 @@ const GoodId = () => {
}, [certificateSubjects, isWhitelisted])

const [isGoodIdEnabled] = usePromise(async () => {
if (isMiniPay) return false
if (enabled || whitelist?.includes(account)) return true

return isSupportedCountry(countries)
}, [enabled, whitelist, countries, account])
}, [enabled, whitelist, countries, account, isMiniPay])

const onExit = useCallback(() => {
setSkipSegmentation(isUpgraded === true)
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5205,9 +5205,9 @@ __metadata:
languageName: node
linkType: hard

"@gooddollar/good-design@npm:0.4.1-beta.0be3b9e7":
version: 0.4.1-beta.0be3b9e7
resolution: "@gooddollar/good-design@npm:0.4.1-beta.0be3b9e7"
"@gooddollar/good-design@npm:0.4.1-beta.a4fdd345":
version: 0.4.1-beta.a4fdd345
resolution: "@gooddollar/good-design@npm:0.4.1-beta.a4fdd345"
dependencies:
"@babel/core": ^7.18.10
"@babel/runtime": ^7.18.9
Expand Down Expand Up @@ -5250,7 +5250,7 @@ __metadata:
react-use-promise: ^0.5.0
react-use-wizard: ^2.3.0
require-from-string: ^2.0.2
checksum: 181c0008b7f0f46c73a5e8d09bb4d1aba9e7243ae9315741e8714f08ab3766a765d98f0909a857465414f44d6faa360b190977f95e35f5340dbbb5e17792018d
checksum: 4b3a2e90b877f085cc01cf01948ed27caa0489acad2db6bfb852168321f260c4f9a5ddd82cb6a1004ce21c85e5f08f10e76bc9fefa06782cdc693780e44d4c10
languageName: node
linkType: hard

Expand Down Expand Up @@ -5324,10 +5324,10 @@ __metadata:
"@ethersproject/experimental": ^5.0.1
"@fontsource/dm-sans": ^4.2.2
"@fullhuman/postcss-purgecss": ^4.0.3
"@gooddollar/good-design": 0.4.1-beta.0be3b9e7
"@gooddollar/good-design": 0.4.1-beta.a4fdd345
"@gooddollar/goodprotocol": ^2.0.24
"@gooddollar/web3sdk": ^0.1.42
"@gooddollar/web3sdk-v2": 0.4.1-beta.0be3b9e7
"@gooddollar/web3sdk-v2": 0.4.1-beta.a4fdd345
"@headlessui/react": 1.5.0
"@hot-loader/react-dom": ^17.0.1
"@lingui/cli": ^4.0.0
Expand Down Expand Up @@ -5507,9 +5507,9 @@ __metadata:
languageName: unknown
linkType: soft

"@gooddollar/web3sdk-v2@npm:0.4.1-beta.0be3b9e7":
version: 0.4.1-beta.0be3b9e7
resolution: "@gooddollar/web3sdk-v2@npm:0.4.1-beta.0be3b9e7"
"@gooddollar/web3sdk-v2@npm:0.4.1-beta.a4fdd345":
version: 0.4.1-beta.a4fdd345
resolution: "@gooddollar/web3sdk-v2@npm:0.4.1-beta.a4fdd345"
dependencies:
"@amplitude/analytics-browser": ^1.6.4
"@amplitude/analytics-react-native": ^0.7.0
Expand Down Expand Up @@ -5560,7 +5560,7 @@ __metadata:
"@usedapp/core": "*"
react-native: "*"
react-native-web: "*"
checksum: 400d5cf33947a8744704242582932fe12e7935abec3399ecf101d916c11965c3ebb26efd97dd3b79c71c9be5ed5934b598b94949ef3480226e6197833c792882
checksum: 98192f0bc9a32b9bd7bcf2dfcc0e9c4746e98d1f3350d4bba62a3365428f641e66cc42f0b4a2a7a4b2f080eb081f532188039005063db76eb1d8ca42df472ee7
languageName: node
linkType: hard

Expand Down

0 comments on commit 387d31d

Please sign in to comment.