@@ -33,6 +33,7 @@ import {
36} from './utils/roller';
37} from './utils/roller';
37import { ETH_ZERO_ADDR, ROLLER_HOSTS, TEN_SECONDS } from './constants';
38import { ETH_ZERO_ADDR, ROLLER_HOSTS, TEN_SECONDS } from './constants';
@@ -51,6 +52,7 @@ import { useTimerStore } from 'store/timerStore';
51import { ReticketParams, SendL2Params } from './types/L2Transaction';
52import { ReticketParams, SendL2Params } from './types/L2Transaction';
52import { L1Point } from './types/L1Point';
53import { L1Point } from './types/L1Point';
53import { ddmmmYYYY } from './utils/date';
54import { ddmmmYYYY } from './utils/date';
55+import { showNotification } from './utils/notifications';
54import { useWalletConnect } from './useWalletConnect';
56import { useWalletConnect } from './useWalletConnect';
56const ONE_SECOND = 1000;
58const ONE_SECOND = 1000;
@@ -190,10 +192,9 @@ export default function useRoller() {
190 const pointNum = Number(point);
192 const pointNum = Number(point);
192 const rawDetails = await api.getPoint(pointNum);
194 const rawDetails = await api.getPoint(pointNum);
194− rawDetails?.dominion === 'l2'
195+ const l2Quota = isL2Spawn(rawDetails?.dominion)
195− ? await api.getRemainingQuota(pointNum)
196+ ? await api.getRemainingQuota(pointNum)
197 const details = toL1Details(rawDetails);
198 const details = toL1Details(rawDetails);
199 return new Point({
200 return new Point({
@@ -246,8 +247,8 @@ export default function useRoller() {
246 if (!updatedPoint.isPlaceholder && changedField) {
247 if (!updatedPoint.isPlaceholder && changedField) {
247 updatePoint(updatedPoint);
248 updatePoint(updatedPoint);
248 clearInterval(interval);
249 clearInterval(interval);
249− if (Notification?.permission === 'granted' && notify) {
250+ if (notify) {
250− new Notification(
251+ showNotification(
251 `${message || getUpdatedPointMessage(updatedPoint, changedField)}`
252 `${message || getUpdatedPointMessage(updatedPoint, changedField)}`
@@ -530,6 +531,9 @@ export default function useRoller() {
531 setStoredInvites(ls, invites);
532 setStoredInvites(ls, invites);
532 getInvites();
533 getInvites();
535+ `Your invite${invites.length > 1 ? 's have' : ' has'} been generated!`
@@ -996,7 +1000,7 @@ export default function useRoller() {
996 }, [config, fetchConfig]);
1000 }, [config, fetchConfig]);
998 useEffect(() => {
1002 useEffect(() => {
999− const time = isDevelopment ? 10000 : ONE_SECOND;
1003+ const time = ONE_SECOND;
1001 const interval = setInterval(() => {
1005 const interval = setInterval(() => {
1002 const nextRoll = getTimeToNextBatch(nextBatchTime, new Date().getTime());
1006 const nextRoll = getTimeToNextBatch(nextBatchTime, new Date().getTime());
@@ -1010,10 +1014,8 @@ export default function useRoller() {
1010 getPendingTransactions();
1014 getPendingTransactions();
1012 setTimeout(() => {
1016 setTimeout(() => {
1013− getPendingTransactions();
1015 if (!point.isDefault) {
1017 if (!point.isDefault) {
1016− getInvites();
1018+ getInvites(); // This will also get pending txns
1018 }, TEN_SECONDS); // Should this be more like a minute?
1020 }, TEN_SECONDS); // Should this be more like a minute?