Skip to content

Commit

Permalink
Fix errors and jump to new version 2 (2.0.5) (#50)
Browse files Browse the repository at this point in the history
* feat: fix errors and jump to new version 2 (2.0.5)

* feat: update nv2

* ref: remove logs
  • Loading branch information
ErnaneJ authored Jun 15, 2024
1 parent 7baab98 commit 4f09e55
Show file tree
Hide file tree
Showing 10 changed files with 595 additions and 408 deletions.
2 changes: 1 addition & 1 deletion assets/scripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class Application {

#chromeRuntimeOnMessage(){
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
console.log(message)
if (message.type !== "changeScreen") return;

this.setScreen(message.data.screen);
Expand All @@ -56,6 +55,7 @@ class Application {
'loading', // Information are being loaded
'started', // User is signed in and working
'not-started', // User is signed in but not working
'not-logged', // User is not signed in
'disabled' // Extension is disabled
];

Expand Down
18 changes: 11 additions & 7 deletions assets/scripts/background.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
class BackgroundHelper {
static passTimeInStringToMinutes(time) {
let [hour, minute] = time.split(':').map(v => parseInt(v));

if (isNaN(hour)) hour = (new Date).getHours();
if (isNaN(minute)) minute = (new Date).getMinutes();

if (!minute) minute = 0;
try{
let [hour, minute] = time.split(':').map(v => parseInt(v));

return (minute + (hour * 60));
if (isNaN(hour)) hour = (new Date).getHours();
if (isNaN(minute)) minute = (new Date).getMinutes();

if (!minute) minute = 0;

return (minute + (hour * 60));
}catch(e){
return 0;
}
}
}
class Events {
Expand Down
Loading

0 comments on commit 4f09e55

Please sign in to comment.