fix(ui): fix bookmarking; fix icon gen to remove weird attrs
This commit is contained in:
parent
e3b924a046
commit
200c56bfb8
3 changed files with 14 additions and 12 deletions
File diff suppressed because one or more lines are too long
|
|
@ -159,11 +159,11 @@ const reducer = (state = initialState, action = {}) => {
|
|||
const wasInFavorite = state.get('favoriteList').findIndex(({ sessionId }) => sessionId === id) > -1;
|
||||
|
||||
return state
|
||||
.update('list', (list) => list.map((session) => (session.sessionId === id ? session.set('favorite', !wasInFavorite) : session)))
|
||||
.update('favoriteList', (list) =>
|
||||
wasInFavorite ? list.filter(({ sessionId }) => sessionId !== id) : list.push(session.set('favorite', true))
|
||||
)
|
||||
.update('current', (session) => (session.sessionId === id ? session.set('favorite', !wasInFavorite) : session));
|
||||
.update('current', (currentSession) => (currentSession.sessionId === id ? currentSession.set('favorite', !wasInFavorite) : currentSession))
|
||||
.update('list', (list) => list.map((listSession) => (listSession.sessionId === id ? listSession.set('favorite', !wasInFavorite) : listSession)))
|
||||
.update('favoriteList', (list) => session ?
|
||||
wasInFavorite ? list.filter(({ sessionId }) => sessionId !== id) : list.push(session.set('favorite', true)) : list
|
||||
);
|
||||
}
|
||||
case SORT: {
|
||||
const comparator = (s1, s2) => {
|
||||
|
|
|
|||
|
|
@ -90,9 +90,11 @@ ${icons.map(icon => {
|
|||
.replace(/xmlns\:xlink/g, 'xmlnsXlink')
|
||||
.replace(/clip-path/g, 'clipPath')
|
||||
.replace(/clip-rule/g, 'clipRule')
|
||||
.replace(/fill-opacity/g, 'fillOpacity')
|
||||
.replace(/stop-color/g, 'stopColor')
|
||||
.replace(/xml:space="preserve"/g, '')};`
|
||||
}).join('\n')}
|
||||
.replace(/xml:space="preserve"/g, '')};`;
|
||||
})
|
||||
.join('\n')}
|
||||
default:
|
||||
return <svg width={ width } height={ height } />;
|
||||
// if (window.ENV.PRODUCTION) return null;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue