export const elementUrl = "https://element.io";
export const postRefetchSeconds: number = 60 * 1000;
-export const fetchLimit = 20;
+export const fetchLimit = 40;
export const trendingFetchLimit = 6;
export const mentionDropdownFetchLimit = 10;
export const commentTreeMaxDepth = 8;
function notify(info: NotifyInfo, router: any) {
messageToastify(info, router);
- // TODO absolute nightmare bug, but notifs are currently broken.
- // Notification.new will try to do a browser fetch ???
-
- // if (Notification.permission !== "granted") Notification.requestPermission();
- // else {
- // var notification = new Notification(info.name, {
- // icon: info.icon,
- // body: info.body,
- // });
-
- // notification.onclick = (ev: Event): any => {
- // ev.preventDefault();
- // router.history.push(info.link);
- // };
- // }
+ if (Notification.permission !== "granted") Notification.requestPermission();
+ else {
+ var notification = new Notification(info.name, {
+ ...{ body: info.body },
+ ...(info.icon.isSome() && { icon: info.icon.unwrap() }),
+ });
+
+ notification.onclick = (ev: Event): any => {
+ ev.preventDefault();
+ router.history.push(info.link);
+ };
+ }
}
export function setupTribute() {