Skip to content

Commit c4b250e

Browse files
authored
[Release] Hotfix 2.31.1 => 2.31.2 (patch) (#12091)
1 parent deff5a6 commit c4b250e

File tree

21 files changed

+68
-53
lines changed

21 files changed

+68
-53
lines changed

packages/injected-script/shared/twitter.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
export const TWITTER_RESERVED_SLUGS: readonly string[] = [
33
'404',
44
'account',
5+
'jobs',
56
'download',
67
'explore',
78
'follower_requests',

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export function ProfileTab(props: ProfileTabProps) {
5252
}, [])
5353

5454
return (
55-
<div key="nfts" className={classes.root}>
55+
<div key="web3" className={classes.root}>
5656
<Typography
5757
className={classes.button + ' ' + (active ? classes.selected : '')}
5858
onClick={onClick}

packages/mask/content-script/site-adaptors/twitter.com/injection/ProfileTab.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Services from '#services'
22
import { MutationObserverWatcher } from '@dimensiondev/holoflows-kit'
3+
import { TWITTER_RESERVED_SLUGS } from '@masknet/injected-script/shared'
34
import { useCollectionByTwitterHandle } from '@masknet/shared'
45
import { BooleanPreference, MaskMessages, PluginID, ProfileTabs } from '@masknet/shared-base'
56
import { makeStyles } from '@masknet/theme'
@@ -397,6 +398,9 @@ function InjectProfileTab() {
397398
return () => ac.abort()
398399
}, [windowSize, tabList, web3TabRef, nextArrow])
399400

401+
const [, slug, category] = location.pathname.split('/')
402+
if (slug && (TWITTER_RESERVED_SLUGS.includes(slug) || category === 'communities')) return null
403+
400404
return (
401405
<div ref={setWeb3TabRef} className={classes.bar}>
402406
<ProfileTabForTokenAndPersona />

packages/plugins/FileService/src/SiteAdaptor/components/Terms.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ export function Terms() {
9797
<Trans>
9898
Web3 File Service is a decentralized storage service provided by Mask Network. It allows users
9999
to store files in different decentralized networks. This feature is powered by Mask Network's
100-
partner file storage protocols such as IPFS, Arweave and Meson Network. It supports files in
101-
PDF, DOC, JPG, PNG, MP3, MP4 and other formats. At present, the maximum file size is 10 MB.
100+
partner file storage protocols such as IPFS and Arweave. It supports files in PDF, DOC, JPG,
101+
PNG, MP3, MP4 and other formats. At present, the maximum file size is 10 MB.
102102
<br />
103103
<br />
104104
You can store files in multiple decentralized networks through the Web3 file service. When

packages/plugins/FileService/src/SiteAdaptor/components/UploadFile.tsx

+2-22
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ const useStyles = makeStyles()((theme) => ({
7676
export function UploadFile() {
7777
const { classes, theme } = useStyles()
7878
const [encrypted, setEncrypted] = useState(true)
79-
const [useCDN, setUseCDN] = useState(false)
8079
const [provider, setProvider] = useState<Provider>(Provider.Arweave)
8180
const { recentFiles, uploadingFiles, uploadFile, attachToPost } = useFileManagement()
8281

@@ -97,29 +96,11 @@ export function UploadFile() {
9796

9897
const onSelectFile = useCallback(
9998
async (file: File) => {
100-
await uploadFile(file, provider, useCDN, encrypted)
99+
await uploadFile(file, provider, encrypted)
101100
},
102-
[encrypted, useCDN, provider],
101+
[encrypted, provider],
103102
)
104103

105-
const cdnButton =
106-
provider === Provider.Arweave ?
107-
<FormControlLabel
108-
control={
109-
<Checkbox
110-
classes={{ root: classes.control, checked: classes.checked }}
111-
color="primary"
112-
checked={useCDN}
113-
icon={<Icons.CheckboxBlank size={18} />}
114-
checkedIcon={<Icons.Checkbox color={theme.palette.maskColor.primary} size={18} />}
115-
onChange={(event) => setUseCDN(event.target.checked)}
116-
/>
117-
}
118-
className={classes.label}
119-
label={<Trans>Use Meson CDN</Trans>}
120-
/>
121-
: null
122-
123104
return (
124105
<section className={classes.container}>
125106
<UploadDropArea className={classes.uploadArea} maxFileSize={MAX_FILE_SIZE} onSelectFile={onSelectFile} />
@@ -158,7 +139,6 @@ export function UploadFile() {
158139
className={classes.label}
159140
label={<Trans>Make It Encrypted</Trans>}
160141
/>
161-
{cdnButton}
162142
</section>
163143
<Typography className={classes.heading}>
164144
<Trans>Uploaded files</Trans>

packages/plugins/FileService/src/SiteAdaptor/contexts/FileManagement/index.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface FileManagementContextOptions {
3232
uploadStateMap: UploadStateMap
3333
setUploadProgress: (id: string, progress: number) => void
3434
setUploadingFiles: Dispatch<SetStateAction<FileInfo[]>>
35-
uploadFile: (file: File, provider: Provider, useCDN: boolean, encrypted: boolean) => Promise<FileInfo>
35+
uploadFile: (file: File, provider: Provider, encrypted: boolean) => Promise<FileInfo>
3636
attachToPost: (info: FileInfo | FileInfo[]) => void
3737
}
3838

@@ -84,10 +84,10 @@ export const FileManagementProvider = memo(({ children, compositionType }: Props
8484
}, [])
8585

8686
const uploadFile = useCallback(
87-
async (file: File, provider: Provider, useCDN: boolean, encrypted: boolean) => {
87+
async (file: File, provider: Provider, encrypted: boolean) => {
8888
const key = encrypted ? makeFileKey() : undefined
8989
const buffer = new Uint8Array(await file.arrayBuffer())
90-
const id = await digest(file, [provider, useCDN, encrypted])
90+
const id = await digest(file, [provider, encrypted])
9191
const createdAt = Date.now()
9292

9393
const removeUnloadingFile = (id: string) => {
@@ -126,7 +126,6 @@ export const FileManagementProvider = memo(({ children, compositionType }: Props
126126
txId: payloadTxID,
127127
type: file.type,
128128
key,
129-
useCDN,
130129
})
131130

132131
const fileInfo: FileInfo = {

packages/plugins/FileService/src/Worker/arweave.ts

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { encodeText } from '@masknet/kit'
55
import type Transaction from 'arweave/web/lib/transaction.js'
66
import type { JWKInterface } from 'arweave/web/lib/wallet.js'
77
import { fetchText } from '@masknet/web3-providers/helpers'
8-
import { LANDING_PAGE, MESON_PREFIX, Provider } from '../constants.js'
8+
import { LANDING_PAGE, Provider } from '../constants.js'
99
import { sign } from './remote-signing.js'
1010
import TOKEN from './arweave-token.json' with { type: 'json' }
1111
import type { ProviderAgent, LandingPageMetadata, AttachmentOptions } from '../types.js'
@@ -41,10 +41,7 @@ class ArweaveAgent implements ProviderAgent {
4141

4242
async uploadLandingPage(metadata: LandingPageMetadata) {
4343
this.init()
44-
let linkPrefix = 'https://arweave.net'
45-
if (metadata.useCDN) {
46-
linkPrefix = MESON_PREFIX
47-
}
44+
const linkPrefix = 'https://arweave.net'
4845
const encodedMetadata = JSON.stringify({
4946
name: metadata.name,
5047
size: metadata.size,

packages/plugins/FileService/src/constants.ts

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export const MAX_FILE_SIZE = 10 * 1000 * 1000
77
export const LANDING_PAGE = 'https://files.r2d2.to/partner/arweave/landing-page.html'
88
export const RECOVERY_PAGE = 'https://fileservice.r2d2.to/recover'
99
export const ARWEAVE_SIGNING = 'https://service.r2d2.to/arweave-remote-signing'
10-
export const MESON_PREFIX = 'https://pz-yyxfhb.meson.network'
1110

1211
export const enum RoutePaths {
1312
Browser = '/browser',

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

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

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

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

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

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

0 commit comments

Comments
 (0)