Commit cb2fa5f 1 parent bc15fd0 commit cb2fa5f Copy full SHA for cb2fa5f
File tree 3 files changed +26
-34
lines changed
3 files changed +26
-34
lines changed Original file line number Diff line number Diff line change @@ -94,7 +94,6 @@ export const AnnictTrack: React.FC<{
94
94
return
95
95
}
96
96
setEpisodeId ( found ?. annictId )
97
- setEpisodeInfo ( null )
98
97
} , [ episodeInfo , work ] )
99
98
useEffect ( ( ) => {
100
99
if ( ! workId ) {
@@ -115,7 +114,7 @@ export const AnnictTrack: React.FC<{
115
114
} )
116
115
. catch ( console . error )
117
116
. finally ( ( ) => setIsLoading ( false ) )
118
- } , [ workId , linkedAt , timing ] )
117
+ } , [ workId , timing ] )
119
118
const [ isStatusChanging , setIsStatusChanging ] = useState ( false )
120
119
useEffect ( ( ) => {
121
120
if ( ! work || work . viewerStatusState === watchStatus ) {
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ export const SearchWorkForm: React.FC<{
48
48
)
49
49
50
50
return (
51
- < div className = { clsx ( "relative" ) } >
51
+ < div className = { clsx ( "relative" ) } onMouseLeave = { ( ) => setIsVisible ( false ) } >
52
52
< form
53
53
className = "flex items-center justify-center space-x-2"
54
54
onSubmit = { ( e ) => {
@@ -81,38 +81,32 @@ export const SearchWorkForm: React.FC<{
81
81
"transition-opacity" ,
82
82
! isVisible || works === null
83
83
? "opacity-0 pointer-events-none"
84
- : "opacity-100"
84
+ : "opacity-100" ,
85
+ "bg-gray-700" ,
86
+ "overflow-auto" ,
87
+ "p-2" ,
88
+ "rounded-md"
85
89
) }
86
- onMouseLeave = { ( ) => setIsVisible ( false ) }
90
+ style = { { maxHeight : "66vh" } }
87
91
>
88
92
{ works !== null ? (
89
93
0 < works . length ? (
90
- < div
91
- className = { clsx (
92
- "w-full" ,
93
- "bg-gray-700" ,
94
- "overflow-auto" ,
95
- "p-2" ,
96
- "rounded-md"
97
- ) }
98
- >
99
- { ( works || [ ] ) . map ( ( work ) => (
100
- < p
101
- key = { work . id }
102
- className = { clsx (
103
- "truncate" ,
104
- "cursor-pointer" ,
105
- "px-2" ,
106
- "py-1" ,
107
- "hover:bg-gray-600" ,
108
- "transition-colors"
109
- ) }
110
- onClick = { ( ) => setWorkId ( work . annictId ) }
111
- >
112
- { work . title }
113
- </ p >
114
- ) ) }
115
- </ div >
94
+ ( works || [ ] ) . map ( ( work ) => (
95
+ < p
96
+ key = { work . id }
97
+ className = { clsx (
98
+ "truncate" ,
99
+ "cursor-pointer" ,
100
+ "px-2" ,
101
+ "py-1" ,
102
+ "hover:bg-gray-600" ,
103
+ "transition-colors"
104
+ ) }
105
+ onClick = { ( ) => setWorkId ( work . annictId ) }
106
+ >
107
+ { work . title }
108
+ </ p >
109
+ ) )
116
110
) : (
117
111
< div
118
112
className = { clsx (
@@ -121,7 +115,6 @@ export const SearchWorkForm: React.FC<{
121
115
"justify-center" ,
122
116
"p-8" ,
123
117
"text-gray-400" ,
124
- "bg-gray-700" ,
125
118
"w-full" ,
126
119
"text-sm"
127
120
) }
Original file line number Diff line number Diff line change @@ -157,7 +157,7 @@ const main: InitPlugin = {
157
157
} , [ ] )
158
158
const [ sayaDefinition , setSayaDefinition ] =
159
159
useState < SayaDefinition | null > ( null )
160
- const [ arm , setArm ] = useState < ARM [ ] > ( [ ] )
160
+ const [ arm , setArm ] = useState < ARM [ ] | null > ( null )
161
161
useEffect ( ( ) => {
162
162
Axios . get < string > (
163
163
"https://raw.githack.com/SlashNephy/saya/dev/docs/definitions.yml" ,
@@ -182,7 +182,7 @@ const main: InitPlugin = {
182
182
< >
183
183
< style > { tailwind } </ style >
184
184
< div className = "w-full h-screen bg-gray-900 text-gray-100 flex leading-loose" >
185
- { setting . accessToken && services && sayaDefinition ? (
185
+ { setting . accessToken && services && sayaDefinition && arm ? (
186
186
< AnnictTrack
187
187
accessToken = { setting . accessToken }
188
188
playingContent = { playingContent }
You can’t perform that action at this time.
0 commit comments