Skip to content

Commit

Permalink
Persist notifications for longer
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahvdAa committed Jul 20, 2023
1 parent 824d2ca commit 53e2a8f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/CanvasPlacer.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,10 @@ export class CanvasPlacer {

infoNotification(lang().TOAST_PLACING_PIXEL_AT.replace('{x}', displayX).replace('{y}', displayY));
let delay = await placePixel(client, canvasX, canvasY, pi, canvas);
let timeout = Math.max(this.cooldownEndsAt - Date.now(), 1000);
infoNotification(lang().TOAST_PLACED_PIXEL_AT.replace('{x}', displayX).replace('{y}', displayY), timeout);

if (typeof delay === 'number') {
this.cooldownEndsAt = delay;
let timeout = Math.max(this.cooldownEndsAt - Date.now(), 1000);
infoNotification(lang().TOAST_PLACED_PIXEL_AT.replace('{x}', displayX).replace('{y}', displayY), timeout);
infoNotification(lang().TOAST_PLACE_PIXELS_IN.replace('{time}', new Date(this.cooldownEndsAt).toLocaleTimeString()), null, timeout);
}

Expand Down

0 comments on commit 53e2a8f

Please sign in to comment.