mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-26 11:03:01 +00:00
Update CustomEmojiService.ts
This commit is contained in:
parent
d06d1e8682
commit
72031e49fc
1 changed files with 1 additions and 0 deletions
|
@ -45,6 +45,7 @@ export class CustomEmojiService {
|
||||||
fetcher: () => this.emojisRepository.find({ where: { host: IsNull() } }).then(emojis => new Map(emojis.map(emoji => [emoji.name, emoji]))),
|
fetcher: () => this.emojisRepository.find({ where: { host: IsNull() } }).then(emojis => new Map(emojis.map(emoji => [emoji.name, emoji]))),
|
||||||
toRedisConverter: (value) => JSON.stringify(Array.from(value.values())),
|
toRedisConverter: (value) => JSON.stringify(Array.from(value.values())),
|
||||||
fromRedisConverter: (value) => {
|
fromRedisConverter: (value) => {
|
||||||
|
if (!Array.isArray(JSON.parse(value))) return undefined; // 古いバージョンの壊れたキャッシュが残っていることがある(そのうち消す)
|
||||||
return new Map(JSON.parse(value).map((x) => [x.name, {
|
return new Map(JSON.parse(value).map((x) => [x.name, {
|
||||||
...x,
|
...x,
|
||||||
updatedAt: new Date(x.updatedAt),
|
updatedAt: new Date(x.updatedAt),
|
||||||
|
|
Loading…
Reference in a new issue