Skip to content

Commit

Permalink
Fix incorrect times in popup icons.
Browse files Browse the repository at this point in the history
Now, "icons" selection data is updated along with essential
data, every 30 seconds.
  • Loading branch information
Sashank999 committed Jan 1, 2024
1 parent d6982f3 commit 4310b90
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion extension/changelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": { "major": 6, "minor": 23, "build": 0 },
"title": "Beta",
"date": false,
"logs": { "features": [], "fixes": [], "changes": [], "removed": [] }
"logs": { "features": [], "fixes": [{ "message": "Fix incorrect times in popup icons.", "contributor": "TheFoxMan" }], "changes": [], "removed": [] }
},
{
"version": { "major": 6, "minor": 22, "build": 0 },
Expand Down
4 changes: 3 additions & 1 deletion extension/pages/popup/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,9 @@ async function setupDashboard() {
iconHTML =
text +
" - " +
`<span class="countdown automatic" data-seconds="${textToTime(time)}" data-time-settings='{ "type": "wordTimer" }'>
`<span class="countdown automatic" data-seconds="${
(textToTime(time) - (Date.now() - userdata.timestamp * 1000)) / 1000
}" data-time-settings='{ "type": "wordTimer" }'>
${time}
</span>`;
} else iconHTML = iconText;
Expand Down
3 changes: 1 addition & 2 deletions extension/scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ async function updateUserdata() {
if (updateEssential) {
selections.push("profile", "timestamp");

for (const selection of ["bars", "cooldowns", "travel", "newmessages", "money", "refills"]) {
for (const selection of ["bars", "cooldowns", "travel", "newmessages", "money", "refills", "icons"]) {
if (!settings.apiUsage.user[selection]) continue;

selections.push(selection);
Expand All @@ -352,7 +352,6 @@ async function updateUserdata() {
"merits",
"perks",
"networth",
"icons",
"ammo",
"honors",
"medals",
Expand Down

0 comments on commit 4310b90

Please sign in to comment.