parent
36ead0406d
commit
6ebd6a6a01
|
@ -23,3 +23,5 @@ export const POST_PRIVACY_OPTIONS = [
|
|||
|
||||
export const LONG_POST_LENGTH = 1024
|
||||
export const LONG_POST_TEXT = 'intl.longPost'
|
||||
|
||||
export const MAX_STATUS_CHARS = 500
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { DEFAULT_THEME } from '../../_utils/themeEngine.js'
|
||||
import { mark, stop } from '../../_utils/marks.js'
|
||||
import { MAX_STATUS_CHARS } from '../../_static/statuses.js'
|
||||
|
||||
function computeForInstance (store, computedKey, key, defaultValue) {
|
||||
store.compute(computedKey,
|
||||
|
@ -57,10 +58,18 @@ export function instanceComputations (store) {
|
|||
store.compute(
|
||||
'maxStatusChars',
|
||||
['currentInstanceInfo'],
|
||||
(currentInstanceInfo) => (
|
||||
(currentInstanceInfo) => {
|
||||
if (currentInstanceInfo) {
|
||||
if (currentInstanceInfo.max_toot_chars) {
|
||||
// unofficial api used in glitch-soc and pleroma
|
||||
(currentInstanceInfo && currentInstanceInfo.max_toot_chars) || 500
|
||||
)
|
||||
return currentInstanceInfo.max_toot_chars
|
||||
}
|
||||
if (currentInstanceInfo.configuration && currentInstanceInfo.configuration.statuses && currentInstanceInfo.configuration.statuses.max_characters) {
|
||||
return currentInstanceInfo.configuration.statuses.max_characters
|
||||
}
|
||||
}
|
||||
return MAX_STATUS_CHARS
|
||||
}
|
||||
)
|
||||
|
||||
stop('instanceComputations')
|
||||
|
|
Loading…
Reference in New Issue