Skip to content

Commit

Permalink
Minor refinements and bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
kolbasa committed Mar 31, 2024
1 parent 94952f4 commit d446264
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 7 deletions.
3 changes: 2 additions & 1 deletion www/app/language/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"LESS": "Weniger",
"MORE": "Mehr",
"NAME": "Name",
"UNEXPECTED_ERROR_OCCURRED": "Unerwartete Fehler aufgetreten"
"UNEXPECTED_ERROR_OCCURRED": "Unerwartete Fehler aufgetreten",
"PLEASE_WAIT": "Bitte warten..."
}
3 changes: 2 additions & 1 deletion www/app/language/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"LESS": "Less",
"MORE": "More",
"NAME": "Name",
"UNEXPECTED_ERROR_OCCURRED": "Unexpected errors occurred"
"UNEXPECTED_ERROR_OCCURRED": "Unexpected errors occurred",
"PLEASE_WAIT": "Please wait.."
}
4 changes: 3 additions & 1 deletion www/app/states/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8">
<title>Huely</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="icon" type="image/x-icon" href="../../../assets/favicon.ico">
<link rel="stylesheet" href="../../../app/app.css">
<link rel="stylesheet" href="../../../app/states/home/home.css">
Expand All @@ -16,6 +16,8 @@

<div class="c2">

<div class="c3 loading hidden" lang="PLEASE_WAIT"></div>

<div class="c3">

<table>
Expand Down
15 changes: 13 additions & 2 deletions www/app/states/home/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,16 @@ const refreshList = async () => {
*/
const backButtonListener = () => {
if (window.Capacitor != null) {
window.Capacitor.addListener('App', 'backButton', closeModal);
window.Capacitor.addListener('App', 'backButton', window.closeModal);
}
};

/**
* @returns {void}
*/
const stateChangeListener = () => {
if (window.Capacitor != null) {
window.Capacitor.addListener('App', 'appStateChange', window.closeModal);
}
};

Expand All @@ -40,6 +49,7 @@ const backButtonListener = () => {
window.load = async () => {
await refreshList();
backButtonListener();
stateChangeListener();
};

/* ------------------------------------------------------ */
Expand Down Expand Up @@ -237,7 +247,8 @@ function addLongPressEventListener(tracker, index) {
* @returns {Promise<void>}
*/
window.openTracker = async (index) => {
dom.hide('c1');
dom.hide('c3');
dom.show('loading');
await router.go(states.TRACKER, {tracker: index});
};

Expand Down
4 changes: 3 additions & 1 deletion www/app/states/tracker/tracker.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8">
<title class="title">{{name}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="icon" type="image/x-icon" href="../../../assets/favicon.ico">
<link rel="stylesheet" href="../../../app/app.css">
<link rel="stylesheet" href="../../../app/states/tracker/tracker.css">
Expand All @@ -15,6 +15,8 @@

<div class="c2">

<div class="c3 loading hidden" lang="PLEASE_WAIT"></div>

<div class="c3">

<button class="back-button icon-button" onclick="goToTrackerList();">
Expand Down
7 changes: 6 additions & 1 deletion www/app/states/tracker/tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ const generateYear = () => {
week.unshift(day);
});

if (weeks[0].length === 0) {
weeks.shift();
}

return weeks;
};

Expand Down Expand Up @@ -365,7 +369,8 @@ window.onSelect = async (element) => {
* @returns {Promise<void>}
*/
window.goToTrackerList = async () => {
dom.hide('c1');
dom.hide('c3');
dom.show('loading');
await router.go(states.START);
};

Expand Down

0 comments on commit d446264

Please sign in to comment.