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