feat: maximum of 3 blossom servers
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 41s
All checks were successful
Open PR on Staging / audit_and_check (pull_request) Successful in 41s
This commit is contained in:
parent
18c07556ea
commit
67d33e1aff
@ -22,7 +22,7 @@ import {
|
|||||||
} from '../../../utils/file-servers.ts'
|
} from '../../../utils/file-servers.ts'
|
||||||
import { useAppSelector } from '../../../hooks'
|
import { useAppSelector } from '../../../hooks'
|
||||||
import { useDidMount } from '../../../hooks'
|
import { useDidMount } from '../../../hooks'
|
||||||
import { isValidUrl } from '../../../utils'
|
import { isValidUrl, MAXIMUM_BLOSSOMS_LENGTH } from '../../../utils'
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import { cloneDeep } from 'lodash'
|
import { cloneDeep } from 'lodash'
|
||||||
|
|
||||||
@ -75,6 +75,12 @@ export const ServersPage = () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Object.keys(blossomServersMap).length === MAXIMUM_BLOSSOMS_LENGTH) {
|
||||||
|
return toast.warning(
|
||||||
|
`You can only add a maximum of ${MAXIMUM_BLOSSOMS_LENGTH} blossom servers.`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
const serverURL = `${protocol}${newServerURL?.trim().replace(protocol, '')}`
|
const serverURL = `${protocol}${newServerURL?.trim().replace(protocol, '')}`
|
||||||
if (!serverURL) return
|
if (!serverURL) return
|
||||||
|
|
||||||
|
@ -27,6 +27,8 @@ export const DEFAULT_LOOK_UP_RELAY_LIST = [
|
|||||||
'wss://purplepag.es'
|
'wss://purplepag.es'
|
||||||
]
|
]
|
||||||
|
|
||||||
|
export const MAXIMUM_BLOSSOMS_LENGTH = 3
|
||||||
|
|
||||||
// Uses the https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types list
|
// Uses the https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types list
|
||||||
// Updated on 2024/08/22
|
// Updated on 2024/08/22
|
||||||
export const MOST_COMMON_MEDIA_TYPES = new Map([
|
export const MOST_COMMON_MEDIA_TYPES = new Map([
|
||||||
|
Loading…
Reference in New Issue
Block a user