You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Hydro/packages/ui-default/components/notification/notification.page.js

15 lines
603 B
JavaScript

import Notification from 'vj/components/notification/index';
import { AutoloadPage } from 'vj/misc/Page';
import { i18n } from 'vj/utils';
export default new AutoloadPage('notificationPage', (pagename) => {
const message = i18n(`Hint::Page::${pagename}`);
const item = localStorage.getItem(`hint.${message}`);
if (message !== `Hint::Page::${pagename}` && !item) {
Notification.info(message, message.length * 500);
localStorage.setItem(`hint.${message}`, true);
}
const text = new URL(window.location.href).searchParams.get('notification');
if (text) Notification.success(text);
});