Compare commits
9 Commits
menu-more-
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d518847f5 | ||
| b63b4c6714 | |||
| 595c684e23 | |||
| 3c0c2a3f2e | |||
| ac9b5ef652 | |||
| 099fb6deb6 | |||
| f3e1620057 | |||
| b52eea79c2 | |||
| 8972d2d72a |
@@ -1192,7 +1192,7 @@ function initDatabase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
db.onerror = function (event) {
|
db.onerror = function (event) {
|
||||||
log("[db] DB Error: " + event.target);
|
log("[db] DB Error: ", event.target);
|
||||||
};
|
};
|
||||||
|
|
||||||
canUseLocalDB = true;
|
canUseLocalDB = true;
|
||||||
@@ -1343,7 +1343,14 @@ function resetDb() {
|
|||||||
db.transaction('rankings', 'readwrite').objectStore('rankings').clear();
|
db.transaction('rankings', 'readwrite').objectStore('rankings').clear();
|
||||||
db.transaction('follows', 'readwrite').objectStore('follows').clear();
|
db.transaction('follows', 'readwrite').objectStore('follows').clear();
|
||||||
db.transaction('expenditures', 'readwrite').objectStore('expenditures').clear();
|
db.transaction('expenditures', 'readwrite').objectStore('expenditures').clear();
|
||||||
var osUpdateTimes = db.transaction('update_times', 'readwrite').objectStore('update_times');
|
var ta = db.transaction('update_times', 'readwrite');
|
||||||
|
ta.oncomplete = (event) => {
|
||||||
|
log('[db] resetDb: Transaction complete');
|
||||||
|
};
|
||||||
|
ta.onerror = (event) => {
|
||||||
|
log('[db] resetDb: Transaction failed');
|
||||||
|
};
|
||||||
|
var osUpdateTimes = ta.objectStore('update_times');
|
||||||
osUpdateTimes.put({ table: 'last_sync', time: 1 });
|
osUpdateTimes.put({ table: 'last_sync', time: 1 });
|
||||||
osUpdateTimes.put({ table: 'clubs', time: 0 });
|
osUpdateTimes.put({ table: 'clubs', time: 0 });
|
||||||
osUpdateTimes.put({ table: 'boats', time: 0 });
|
osUpdateTimes.put({ table: 'boats', time: 0 });
|
||||||
@@ -1357,6 +1364,8 @@ function resetDb() {
|
|||||||
osUpdateTimes.put({ table: 'news', time: 0 });
|
osUpdateTimes.put({ table: 'news', time: 0 });
|
||||||
osUpdateTimes.put({ table: 'users', time: 0 });
|
osUpdateTimes.put({ table: 'users', time: 0 });
|
||||||
osUpdateTimes.put({ table: 'expenditures', time: 0 });
|
osUpdateTimes.put({ table: 'expenditures', time: 0 });
|
||||||
|
osUpdateTimes.put({ table: 'loggedin', status: isLoggedIn() });
|
||||||
|
ta.commit();
|
||||||
log('[db] DB update times reset');
|
log('[db] DB update times reset');
|
||||||
hideLoader();
|
hideLoader();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ function pushesSubscribe() {
|
|||||||
applicationServerKey: applicationServerKey
|
applicationServerKey: applicationServerKey
|
||||||
})
|
})
|
||||||
.then(async function(subscription) {
|
.then(async function(subscription) {
|
||||||
log('[app] Subscription:', subscription);
|
log('[app] Subscription:', JSON.stringify(subscription));
|
||||||
if (await pushesUpdateServerSubscription(subscription, true)) {
|
if (await pushesUpdateServerSubscription(subscription, true)) {
|
||||||
log('[app] Subscription: Sent to server, updating UI');
|
log('[app] Subscription: Sent to server, updating UI');
|
||||||
dbSettingsSet('notify_endpoint_' + BOATCLASS, subscription.endpoint);
|
dbSettingsSet('notify_endpoint_' + BOATCLASS, subscription.endpoint);
|
||||||
@@ -346,7 +346,7 @@ function pushesUnSubscribe(silent = false) {
|
|||||||
log('[app] Unsubscribing');
|
log('[app] Unsubscribing');
|
||||||
swRegistration.pushManager.getSubscription()
|
swRegistration.pushManager.getSubscription()
|
||||||
.then(async function(subscription) {
|
.then(async function(subscription) {
|
||||||
log('[app] Subscription:', subscription);
|
log('[app] Subscription:', JSON.stringify(subscription));
|
||||||
if (subscription) {
|
if (subscription) {
|
||||||
if (await pushesUpdateServerSubscription(subscription, false)) {
|
if (await pushesUpdateServerSubscription(subscription, false)) {
|
||||||
log('[app] Subscription: Removed from server');
|
log('[app] Subscription: Removed from server');
|
||||||
@@ -374,7 +374,7 @@ function pushesUnSubscribe(silent = false) {
|
|||||||
|
|
||||||
function pushesUpdateServerSubscription(subscription, enabled) {
|
function pushesUpdateServerSubscription(subscription, enabled) {
|
||||||
return new Promise(function(resolve){
|
return new Promise(function(resolve){
|
||||||
log('[app] updateServer', enabled, subscription);
|
log('[app] updateServer', enabled, JSON.stringify(subscription));
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: QUERY_URL + (enabled ? 'add' : 'remove') + '_subscription',
|
url: QUERY_URL + (enabled ? 'add' : 'remove') + '_subscription',
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
@@ -477,7 +477,7 @@ function updatePushBadge() {
|
|||||||
var dbSub = await dbSettingsGet('notify_endpoint_' + BOATCLASS);
|
var dbSub = await dbSettingsGet('notify_endpoint_' + BOATCLASS);
|
||||||
var isSub = (subscription !== null);
|
var isSub = (subscription !== null);
|
||||||
log('[app] DB Subscription:', dbSub);
|
log('[app] DB Subscription:', dbSub);
|
||||||
log('[app] Real Subscription:', subscription);
|
log('[app] Real Subscription:', JSON.stringify(subscription));
|
||||||
if (isSub) {
|
if (isSub) {
|
||||||
$('#badge-pushes').removeClass('bg-red2-dark').addClass('bg-green2-dark').text('AN');
|
$('#badge-pushes').removeClass('bg-red2-dark').addClass('bg-green2-dark').text('AN');
|
||||||
if (dbSub === null) dbSettingsSet('notify_endpoint_' + BOATCLASS, subscription.endpoint);
|
if (dbSub === null) dbSettingsSet('notify_endpoint_' + BOATCLASS, subscription.endpoint);
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ async function onListClicked(id) {
|
|||||||
if (exp.approved == 0 && (exp.direction < 0) == (exp.canceled == 0)) {
|
if (exp.approved == 0 && (exp.direction < 0) == (exp.canceled == 0)) {
|
||||||
$('#menu-item-approve').show();
|
$('#menu-item-approve').show();
|
||||||
$('#menu-item-approve').attr('onclick', 'expenditureAction("approve", ' + exp['id'] + ', "' + (exp.canceled == 1 ? 'Stornierung' : 'Ausgabe') + ' genehmigt")');
|
$('#menu-item-approve').attr('onclick', 'expenditureAction("approve", ' + exp['id'] + ', "' + (exp.canceled == 1 ? 'Stornierung' : 'Ausgabe') + ' genehmigt")');
|
||||||
$('#menu-item-approve').text(exp.canceled == 1 ? 'Storno akzeptieren' : 'Akzeptieren');
|
$('#menu-item-approve').find('span').text(exp.canceled == 1 ? 'Storno akzeptieren' : 'Akzeptieren');
|
||||||
$('#menu-item-decline').show();
|
$('#menu-item-decline').show();
|
||||||
$('#menu-item-decline').attr('onclick', 'expenditureAction("decline", ' + exp['id'] + ', "Ausgabe ' + (exp.canceled == 1 ? 'erneut angefragt' : 'abgelehnt') + '")');
|
$('#menu-item-decline').attr('onclick', 'expenditureAction("decline", ' + exp['id'] + ', "Ausgabe ' + (exp.canceled == 1 ? 'erneut angefragt' : 'abgelehnt') + '")');
|
||||||
$('#menu-item-decline').text(exp.canceled == 1 ? 'Erneut anfragen' : 'Ablehnen');
|
$('#menu-item-decline').find('span').text(exp.canceled == 1 ? 'Erneut anfragen' : 'Ablehnen');
|
||||||
} else {
|
} else {
|
||||||
$('#menu-item-approve').hide();
|
$('#menu-item-approve').hide();
|
||||||
$('#menu-item-decline').hide();
|
$('#menu-item-decline').hide();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
define('PWA_VERSION', '1.13h2');
|
define('PWA_VERSION', '1.13h6');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user