mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-21 17:37:29 -07:00
make pinned post limit configurable
This commit is contained in:
parent
6c2131fdcc
commit
a44a89276d
4 changed files with 8 additions and 1 deletions
|
@ -180,6 +180,9 @@ reservedUsernames: [
|
|||
# notFound: '/twemoji/2049.svg'
|
||||
# error: '/twemoji/1f480.svg'
|
||||
|
||||
# Pinned Post Limit
|
||||
# pinLimit: 5
|
||||
|
||||
# Search engine (MFM)
|
||||
#searchEngine: 'https://duckduckgo.com/?q='
|
||||
|
||||
|
|
|
@ -54,6 +54,8 @@ export default function load() {
|
|||
...config.images,
|
||||
};
|
||||
|
||||
config.pinLimit = config.pinLimit || parseInt(process.env.pinLimit || "", 100);
|
||||
|
||||
config.htmlCache = {
|
||||
ttlSeconds: parseDuration(config.htmlCache?.ttl ?? '1h', 's')!,
|
||||
prewarm: false,
|
||||
|
|
|
@ -53,6 +53,8 @@ export type Source = {
|
|||
info?: string;
|
||||
};
|
||||
|
||||
pinLimit?: number;
|
||||
|
||||
htmlCache?: {
|
||||
ttl?: string;
|
||||
ttlSeconds?: number;
|
||||
|
|
|
@ -35,7 +35,7 @@ export async function addPinned(
|
|||
|
||||
const pinings = await UserNotePinings.findBy({ userId: user.id });
|
||||
|
||||
if (pinings.length >= 5) {
|
||||
if (pinings.length >= config.pinLimit) {
|
||||
throw new IdentifiableError(
|
||||
"15a018eb-58e5-4da1-93be-330fcc5e4e1a",
|
||||
"You can not pin notes any more.",
|
||||
|
|
Loading…
Reference in a new issue