mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-11-26 10:50:24 -06:00
Backward compatibility fix with SDA 9.2.0 and client 1.5
This commit is contained in:
parent
f626e997b3
commit
fbcae64c74
@ -169,7 +169,7 @@ export default class NotificationComp extends React.Component<
|
||||
title={i18n.t('Close')()}
|
||||
onClick={this.eventHandlers.onClose(id)}
|
||||
>
|
||||
<img src={closeImgFilePath} alt='close' />
|
||||
<img src={closeImgFilePath} title={i18n.t('Close')()} alt='close' />
|
||||
</div>
|
||||
<div
|
||||
className='main-container'
|
||||
@ -429,10 +429,24 @@ export default class NotificationComp extends React.Component<
|
||||
*/
|
||||
private updateState(_event, data): void {
|
||||
const { color } = data;
|
||||
data.color = this.isValidColor(color) ? color : '';
|
||||
// FYI: 1.5 sends hex color but without '#', reason why we check and add prefix if necessary.
|
||||
// Goal is to keep backward compatibility with 1.5 colors (SDA v. 9.2.0)
|
||||
const isOldColor = /^([A-Fa-f0-9]{6})/.test(color);
|
||||
data.color = isOldColor
|
||||
? `#${color}`
|
||||
: this.isValidColor(color)
|
||||
? color
|
||||
: '';
|
||||
data.isInputHidden = true;
|
||||
data.containerHeight = CONTAINER_HEIGHT;
|
||||
data.theme = data.theme ? data.theme : Themes.LIGHT;
|
||||
// FYI: 1.5 doesn't send current theme. We need to deduce it from the color that is sent.
|
||||
// Goal is to keep backward compatibility with 1.5 themes (SDA v. 9.2.0)
|
||||
data.theme =
|
||||
isOldColor && darkTheme.includes(data.color)
|
||||
? Themes.DARK
|
||||
: data.theme
|
||||
? data.theme
|
||||
: Themes.LIGHT;
|
||||
this.resetNotificationData();
|
||||
this.setState(data as INotificationState);
|
||||
}
|
||||
|
@ -27,7 +27,6 @@
|
||||
--notification-border-color: #717681;
|
||||
--button-color: #b0b3ba;
|
||||
--button-border-color: #b0b3ba;
|
||||
--button-border-color: #717681;
|
||||
--button-hover-color: #cdcfd4;
|
||||
--button-hover-border-color: #cdcfd4;
|
||||
--button-hover-bg-color: #3a3d43;
|
||||
|
Loading…
Reference in New Issue
Block a user