@@ -44,7 +44,7 @@ import { useRollerOptions } from './useRollerOptions';
44import { useTimerStore } from 'store/timerStore';
44import { useTimerStore } from 'store/timerStore';
46interface UpdateParams {
46interface UpdateParams {
47− point: number;
47+ point?: Point | number;
48 message?: string;
48 message?: string;
49 notify?: boolean;
49 notify?: boolean;
50 field?: PointField;
50 field?: PointField;
@@ -140,7 +140,7 @@ export default function useRoller() {
140 }, [nextQuotaTime, point, setModalText]);
140 }, [nextQuotaTime, point, setModalText]);
142 const initPoint = useCallback(
142 const initPoint = useCallback(
143− async (point: string | number) => {
143+ async (point: string | number): Promise<Point> => {
144 const _wallet = wallet.getOrElse(null);
144 const _wallet = wallet.getOrElse(null);
145 const _contracts = contracts.getOrElse(null);
145 const _contracts = contracts.getOrElse(null);
@@ -210,25 +210,25 @@ export default function useRoller() {
212 intervalTime = TEN_SECONDS,
212 intervalTime = TEN_SECONDS,
214 }: UpdateParams) => {
213 }: UpdateParams) => {
216− point = point === undefined ? await initPoint(pointValue) : point;
216+ const p = (typeof point === 'number' ? await initPoint(point) : point) as Point
218 if (l1Txn) storePendingL1Txn(l1Txn);
218 if (l1Txn) storePendingL1Txn(l1Txn);
220 let interval: any;
220 let interval: any;
221 const check = async () => {
221 const check = async () => {
222− const changedField = !points[point]
222+ const changedField = !points[p.value]
223 ? 'newPoint'
223 ? 'newPoint'
224− : point.getChangedField(points[point], field);
224+ : p.getChangedField(points[p.value], field);
226 if (isDevelopment) {
226 if (isDevelopment) {
227− console.log(`CHECKING FOR ${changedField} UPDATES:`, point.patp);
227+ console.log(`CHECKING FOR ${changedField} UPDATES:`, p.patp);
230− if (!point.isPlaceholder && changedField) {
230+ if (!p.isPlaceholder && changedField) {
231− updatePoint(point);
231+ updatePoint(p);
232 if (interval) {
232 if (interval) {
233 clearInterval(interval);
233 clearInterval(interval);
@@ -236,7 +236,7 @@ export default function useRoller() {
236 if (l1Txn) deletePendingL1Txn(l1Txn);
236 if (l1Txn) deletePendingL1Txn(l1Txn);
237 if (notify) {
237 if (notify) {
238 showNotification(
238 showNotification(
239− `${message || getUpdatedPointMessage(point, changedField)}`
239+ `${message || getUpdatedPointMessage(p, changedField)}`