fix(play preset): Set failback for notes without text or user.name in Timeline preset (#10718)
This commit is contained in:
parent
a986203b38
commit
52a1d96218
1 changed files with 7 additions and 2 deletions
|
@ -305,6 +305,11 @@ const PRESET_TIMELINE = `/// @ 0.13.1
|
||||||
// それぞれのノートごとにUI要素作成
|
// それぞれのノートごとにUI要素作成
|
||||||
let noteEls = []
|
let noteEls = []
|
||||||
each (let note, notes) {
|
each (let note, notes) {
|
||||||
|
// 表示名を設定していないアカウントはidを表示
|
||||||
|
let userName = if Core:type(note.user.name) == "str" note.user.name else note.user.username
|
||||||
|
// リノートもしくはメディア・投票のみで本文が無いノートに代替表示文を設定
|
||||||
|
let noteText = if Core:type(note.text) == "str" note.text else "(リノートもしくはメディア・投票のみのノート)"
|
||||||
|
|
||||||
let el = Ui:C:container({
|
let el = Ui:C:container({
|
||||||
bgColor: "#444"
|
bgColor: "#444"
|
||||||
fgColor: "#fff"
|
fgColor: "#fff"
|
||||||
|
@ -312,11 +317,11 @@ const PRESET_TIMELINE = `/// @ 0.13.1
|
||||||
rounded: true
|
rounded: true
|
||||||
children: [
|
children: [
|
||||||
Ui:C:mfm({
|
Ui:C:mfm({
|
||||||
text: note.user.name
|
text: userName
|
||||||
bold: true
|
bold: true
|
||||||
})
|
})
|
||||||
Ui:C:mfm({
|
Ui:C:mfm({
|
||||||
text: note.text
|
text: noteText
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue