File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -92,14 +92,16 @@ class LibraryItem extends React.PureComponent {
92
92
this . setState ( { iconIndex : nextIconIndex } ) ;
93
93
}
94
94
curIconMd5 ( ) {
95
+ const iconMd5Prop = this . props . iconMd5 ;
95
96
if ( this . props . icons &&
96
97
this . state . isRotatingIcon &&
97
- this . state . iconIndex < this . props . icons . length &&
98
- this . props . icons [ this . state . iconIndex ] &&
99
- this . props . icons [ this . state . iconIndex ] . baseLayerMD5 ) {
100
- return this . props . icons [ this . state . iconIndex ] . baseLayerMD5 ;
98
+ this . state . iconIndex < this . props . icons . length ) {
99
+ const icon = this . props . icons [ this . state . iconIndex ] || { } ;
100
+ return icon . md5ext || // 3.0 library format
101
+ icon . baseLayerMD5 || // 2.0 library format, TODO GH-5084
102
+ iconMd5Prop ;
101
103
}
102
- return this . props . iconMd5 ;
104
+ return iconMd5Prop ;
103
105
}
104
106
render ( ) {
105
107
const iconMd5 = this . curIconMd5 ( ) ;
@@ -151,7 +153,8 @@ LibraryItem.propTypes = {
151
153
iconRawURL : PropTypes . string ,
152
154
icons : PropTypes . arrayOf (
153
155
PropTypes . shape ( {
154
- baseLayerMD5 : PropTypes . string
156
+ baseLayerMD5 : PropTypes . string , // 2.0 library format, TODO GH-5084
157
+ md5ext : PropTypes . string // 3.0 library format
155
158
} )
156
159
) ,
157
160
id : PropTypes . number . isRequired ,
You can’t perform that action at this time.
0 commit comments