mirror of
https://github.com/billsonnn/nitro-react.git
synced 2025-01-18 21:36:27 +01:00
Fix notification images
This commit is contained in:
parent
09aabe031b
commit
1c1317eadb
@ -59,10 +59,9 @@ export class NotificationUtilities
|
||||
{
|
||||
let imageUrl = options.get('image');
|
||||
|
||||
// eslint-disable-next-line no-template-curly-in-string
|
||||
if(!imageUrl) imageUrl = ('${image.library.url}notifications/' + type.replace(/\./g, '_') + '.png');
|
||||
if(!imageUrl) imageUrl = GetConfiguration<string>('image.library.notifications.url', '').replace('%image', type.replace(/\./g, '_'));
|
||||
|
||||
return imageUrl;
|
||||
return LocalizeText(imageUrl);
|
||||
}
|
||||
|
||||
public static showNotification(type: string, options: Map<string, string> = null): void
|
||||
@ -79,11 +78,9 @@ export class NotificationUtilities
|
||||
const linkUrl = this.getNotificationPart(options, type, 'linkUrl', false);
|
||||
const image = this.getNotificationImageUrl(options, type);
|
||||
|
||||
console.log(image, LocalizeText(image));
|
||||
|
||||
if(options.get('display') === 'BUBBLE')
|
||||
{
|
||||
this.showSingleBubble(LocalizeText(message), NotificationBubbleType.INFO, LocalizeText(image), linkUrl);
|
||||
this.showSingleBubble(LocalizeText(message), NotificationBubbleType.INFO, image, linkUrl);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -65,11 +65,11 @@ export const NotificationCenterMessageHandler: FC<{}> = props =>
|
||||
{
|
||||
const parser = event.getParser();
|
||||
|
||||
if(parser.amountChanged <= 0) return;
|
||||
if((parser.amountChanged <= 0) || (parser.type !== 5)) return;
|
||||
|
||||
const imageUrl = GetConfiguration<string>('currency.asset.icon.url', '').replace('%type%', parser.type.toString());
|
||||
|
||||
NotificationUtilities.showSingleBubble(LocalizeText(`notifications.text.activitypoints.${ parser.type }`, [ 'AMOUNT' ], [ parser.amountChanged.toString() ]), NotificationBubbleType.INFO, imageUrl);
|
||||
NotificationUtilities.showSingleBubble(LocalizeText('notifications.text.loyalty.received', [ 'amount' ], [ parser.amountChanged.toString() ]), NotificationBubbleType.INFO, imageUrl);
|
||||
}, []);
|
||||
|
||||
UseMessageEventHook(ActivityPointNotificationMessageEvent, onActivityPointNotificationMessageEvent);
|
||||
|
Loading…
Reference in New Issue
Block a user