@@ -37,7 +37,7 @@ const styles = css`
37
37
`
38
38
39
39
class Header extends Component {
40
- constructor ( opts ) {
40
+ constructor ( opts ) {
41
41
super ( opts )
42
42
43
43
this . emit = null
@@ -53,12 +53,12 @@ class Header extends Component {
53
53
this . searchComp = new Search ( )
54
54
}
55
55
56
- handleSearch ( val ) {
56
+ handleSearch ( val ) {
57
57
this . search = val
58
58
this . emit ( 'library:search' , val )
59
59
}
60
60
61
- handleAddButton ( ) {
61
+ handleAddButton ( ) {
62
62
if ( ! this . dialogOpen ) {
63
63
this . dialogOpen = true
64
64
const paths = config . get ( 'paths' )
@@ -75,27 +75,27 @@ class Header extends Component {
75
75
}
76
76
}
77
77
78
- handlePaths ( { filePaths } ) {
78
+ handlePaths ( { filePaths } ) {
79
79
this . dialogOpen = false
80
80
if ( Array . isArray ( filePaths ) && filePaths . length > 0 ) {
81
81
this . emit ( 'config:set' , { filePaths } )
82
82
this . emit ( 'library:update-library' , filePaths )
83
83
}
84
84
}
85
85
86
- handleNav ( ) {
86
+ handleNav ( ) {
87
87
this . emit ( 'pushState' , '#preferences' )
88
88
}
89
89
90
- handleDrop ( event ) {
90
+ handleDrop ( event ) {
91
91
event . preventDefault ( )
92
92
const { files } = event . dataTransfer
93
93
94
94
const paths = Array ( files . length ) . fill ( 0 ) . map ( ( _ , i ) => webUtils . getPathForFile ( files . item ( i ) ) )
95
95
this . handlePaths ( { filePaths : paths } )
96
96
}
97
97
98
- createElement ( state , emit ) {
98
+ createElement ( state , emit ) {
99
99
this . emit = emit
100
100
this . search = state . library . search
101
101
this . loading = state . library . loading
@@ -123,7 +123,7 @@ class Header extends Component {
123
123
`
124
124
}
125
125
126
- update ( state , emit ) {
126
+ update ( state , emit ) {
127
127
if ( this . search !== state . library . search ) return true
128
128
if ( this . loading !== state . library . loading ) return true
129
129
return false
0 commit comments