Skip to content

Commit 72cf70f

Browse files
[Release] Hotfix 2.32.1 => 2.32.2 (patch) (#12175)
* chore: bump version to v2.32.2 * feat: mf-6611 redirect users to Firefly to claim firefly redpacket (#12171) * feat: mf-6611 redirect users to Firefly to claim firefly redpacket * Update useAvailability.ts --------- Co-authored-by: guanbinrui <[email protected]> * fix: profile tabs do not update (#12174) --------- Co-authored-by: Wukong Sun <[email protected]>
1 parent 033384b commit 72cf70f

File tree

17 files changed

+78
-12
lines changed

17 files changed

+78
-12
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"yarn": ">=999.0.0",
88
"npm": ">=999.0.0"
99
},
10-
"version": "2.32.1",
10+
"version": "2.32.2",
1111
"private": true,
1212
"license": "AGPL-3.0-or-later",
1313
"scripts": {

packages/mask/content-script/components/InjectedComponents/ProfileTabContent.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,8 @@ function Content(props: ProfileTabContentProps) {
188188
return plugins
189189
.flatMap((x) => x.ProfileTabs?.map((y) => ({ ...y, pluginID: x.ID })) || [])
190190
.filter((x) => {
191-
const shouldDisplay =
192-
x.Utils?.shouldDisplay?.(currentVisitingSocialIdentity, selectedSocialAccount) ?? true
193-
return x.pluginID !== PluginID.NextID && shouldDisplay
191+
if (x.pluginID === PluginID.NextID) return false
192+
return x.Utils?.shouldDisplay?.(currentVisitingSocialIdentity, selectedSocialAccount) ?? true
194193
})
195194
.sort((a, z) => a.priority - z.priority)
196195
})
@@ -199,7 +198,7 @@ function Content(props: ProfileTabContentProps) {
199198
id: x.ID,
200199
label: typeof x.label === 'string' ? x.label : translate(x.label),
201200
}))
202-
}, [activatedPlugins, translate])
201+
}, [activatedPlugins, translate, selectedSocialAccount])
203202

204203
const [currentTab, onChange] = useTabs(first(tabs)?.id ?? PluginID.Collectible, ...tabs.map((tab) => tab.id))
205204

packages/mask/content-script/site-adaptors/twitter.com/collecting/identity.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function resolveCurrentVisitingIdentityInner(
119119
const domAvatar = document.querySelector(`a[href="/${handle}/photo"] img`)
120120
// DOM avatar is more accurate, avatar from api could be outdate
121121
const avatar = domAvatar?.getAttribute('src') || legacy.profile_image_url_https
122-
const bio = legacy.profile_image_url_https
122+
const bio = legacy.description
123123
const homepage = legacy.entities.url?.urls?.[0]?.expanded_url
124124

125125
ref.value = {

packages/plugins/RedPacket/src/SiteAdaptor/RedPacket/index.tsx

+35-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { msg } from '@lingui/core/macro'
22
import { useLingui } from '@lingui/react'
3+
import { Trans } from '@lingui/react/macro'
4+
import { Icons } from '@masknet/icons'
35
import { usePostInfoDetails, usePostLink } from '@masknet/plugin-infra/content-script'
46
import { share } from '@masknet/plugin-infra/content-script/context'
57
import { LoadingStatus, TransactionConfirmModal } from '@masknet/shared'
@@ -12,16 +14,17 @@ import { EVMChainResolver } from '@masknet/web3-providers'
1214
import { RedPacketStatus, type RedPacketJSONPayload } from '@masknet/web3-providers/types'
1315
import { TokenType, formatBalance, isZero, minus } from '@masknet/web3-shared-base'
1416
import { ChainId } from '@masknet/web3-shared-evm'
15-
import { Card, Grow } from '@mui/material'
17+
import { Card, Grow, Link } from '@mui/material'
1618
import { memo, useCallback, useMemo, useState } from 'react'
1719
import { RedPacketEnvelope } from '../components/RedPacketEnvelope.js'
1820
import { Conditions } from '../Conditions/index.js'
1921
import { useAvailabilityComputed } from '../hooks/useAvailabilityComputed.js'
2022
import { useClaimCallback } from '../hooks/useClaimCallback.js'
23+
import { useIsFireflyRedpacket } from '../hooks/useIsFireflyRedpacket.js'
2124
import { useRedPacketContract } from '../hooks/useRedPacketContract.js'
25+
import { useRedPacketCover } from '../hooks/useRedPacketCover.js'
2226
import { useRefundCallback } from '../hooks/useRefundCallback.js'
2327
import { OperationFooter } from './OperationFooter.js'
24-
import { useRedPacketCover } from '../hooks/useRedPacketCover.js'
2528

2629
const useStyles = makeStyles()((theme) => {
2730
return {
@@ -47,6 +50,18 @@ const useStyles = makeStyles()((theme) => {
4750
},
4851
footer: {
4952
margin: theme.spacing(2),
53+
display: 'flex',
54+
height: 40,
55+
gap: theme.spacing(0.5),
56+
alignItems: 'center',
57+
justifyContent: 'center',
58+
borderRadius: 99,
59+
fontSize: 14,
60+
fontWeight: 700,
61+
backgroundColor: theme.palette.maskColor.dark,
62+
color: 'white',
63+
cursor: 'pointer',
64+
textDecoration: 'none !important',
5065
},
5166
envelope: {
5267
height: '100%',
@@ -96,6 +111,8 @@ export const RedPacket = memo(function RedPacket({ payload, currentPluginID }: R
96111
const postUrl = usePostInfoDetails.url()
97112
const handle = usePostInfoDetails.handle()
98113
const link = postLink.toString() || postUrl?.toString()
114+
const isFireflyRedpacket = useIsFireflyRedpacket()
115+
const postId = usePostInfoDetails.postID()
99116

100117
// TODO payload.chainId is undefined on production mode
101118
const network = useNetwork<NetworkPluginID.PLUGIN_EVM>(
@@ -225,6 +242,22 @@ export const RedPacket = memo(function RedPacket({ payload, currentPluginID }: R
225242

226243
if (outdated) return card
227244

245+
if (isFireflyRedpacket) {
246+
return (
247+
<>
248+
{card}
249+
<Link
250+
className={classes.footer}
251+
href={`https://firefly.mask.social/post/twitter/${postId}`}
252+
target="_blank"
253+
rel="noreferrer noopener">
254+
<Icons.LinkOut size={18} />
255+
<Trans>Claim on Firefly</Trans>
256+
</Link>
257+
</>
258+
)
259+
}
260+
228261
return (
229262
<>
230263
{card}

packages/plugins/RedPacket/src/SiteAdaptor/hooks/useAvailability.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ export function useAvailability(
2121
queryKey: ['red-packet', 'check-availability', chainId, version, id, account],
2222
queryFn: async () => {
2323
if (!id || !redPacketContract) return null
24-
return redPacketContract.methods.check_availability(id).call({
24+
const availability = await redPacketContract.methods.check_availability(id).call({
2525
// check availability is ok w/o account
2626
from: account,
2727
})
28+
return availability
2829
},
2930
refetchInterval(query) {
3031
const { data } = query.state
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { usePostInfoDetails } from '@masknet/plugin-infra/content-script'
2+
3+
export function useIsFireflyRedpacket() {
4+
const raw = usePostInfoDetails.rootNode()?.textContent
5+
6+
return raw?.includes('#FireflyLuckyDrop') || false
7+
}

packages/plugins/RedPacket/src/locale/en-US.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/plugins/RedPacket/src/locale/en-US.po

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/plugins/RedPacket/src/locale/ja-JP.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/plugins/RedPacket/src/locale/ja-JP.po

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/plugins/RedPacket/src/locale/ko-KR.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/plugins/RedPacket/src/locale/ko-KR.po

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/plugins/RedPacket/src/locale/zh-CN.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/plugins/RedPacket/src/locale/zh-CN.po

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/plugins/RedPacket/src/locale/zh-TW.json

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/plugins/RedPacket/src/locale/zh-TW.po

+4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/theme/src/Components/CountdownButton/index.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { makeStyles } from '../../entry-base.js'
44

55
const useStyles = makeStyles()({
66
button: {
7+
whiteSpace: 'nowrap',
78
'&:hover': {
89
background: 'transparent',
910
},
@@ -15,7 +16,7 @@ export interface CountdownButtonProps extends ButtonProps {
1516
}
1617

1718
export function CountdownButton(props: CountdownButtonProps) {
18-
const { classes } = useStyles()
19+
const { classes, cx } = useStyles()
1920
const { duration = 60, children, repeatContent = 'Resend', onClick, disabled, ...others } = props
2021
const [countdown, setCountdown] = useState<number | undefined>(undefined)
2122
const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
@@ -29,7 +30,7 @@ export function CountdownButton(props: CountdownButtonProps) {
2930
else
3031
return (
3132
<>
32-
{children} (${countdown})
33+
{children} ({countdown})
3334
</>
3435
)
3536
} else if (countdown === 0) {
@@ -55,7 +56,7 @@ export function CountdownButton(props: CountdownButtonProps) {
5556
return (
5657
<Button
5758
{...others}
58-
className={classes.button}
59+
className={cx(classes.button, others.className)}
5960
onClick={handleClick}
6061
disabled={!!countdown || disabled}
6162
disableRipple

0 commit comments

Comments
 (0)