don't show non-message to user; fix API server setting; misc doc & task stuff
This commit is contained in:
@@ -1,11 +1,6 @@
|
|||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
- remove hard-coded anomalistlabs.com
|
|
||||||
|
|
||||||
- don't show "Give" & "Offer" on project screen if they don't have an identifier
|
|
||||||
- allow some gives even if they aren't registered
|
|
||||||
|
|
||||||
- in endorser-push-server - mount folder for persistent sqlite DB outside of container
|
- in endorser-push-server - mount folder for persistent sqlite DB outside of container
|
||||||
- extract private_key_hex in webpush.py
|
- extract private_key_hex in webpush.py
|
||||||
- 40 notifications :
|
- 40 notifications :
|
||||||
@@ -40,6 +35,7 @@ tasks:
|
|||||||
- bug (that is hard to reproduce) - on the second 'give' recorded on prod it showed me as the agent
|
- bug (that is hard to reproduce) - on the second 'give' recorded on prod it showed me as the agent
|
||||||
- make identicons for contacts into more-memorable faces (and maybe change project identicons, too)
|
- make identicons for contacts into more-memorable faces (and maybe change project identicons, too)
|
||||||
- allow download of each VC (to show that they can actually own their data)
|
- allow download of each VC (to show that they can actually own their data)
|
||||||
|
- allow some gives even if they aren't registered
|
||||||
|
|
||||||
- contacts v+ :
|
- contacts v+ :
|
||||||
- 01 Import all the non-sensitive data (ie. contacts & settings).
|
- 01 Import all the non-sensitive data (ie. contacts & settings).
|
||||||
@@ -69,6 +65,7 @@ tasks:
|
|||||||
|
|
||||||
- .5 show seed phrase in a QR code for transfer to another device
|
- .5 show seed phrase in a QR code for transfer to another device
|
||||||
- .5 on DiscoverView, switch to a filter UI (eg. just from friend
|
- .5 on DiscoverView, switch to a filter UI (eg. just from friend
|
||||||
|
- .5 don't show "Offer" on project screen if they aren't registered
|
||||||
|
|
||||||
- 24 Move to Vite
|
- 24 Move to Vite
|
||||||
- 32 accept images for projects
|
- 32 accept images for projects
|
||||||
|
|||||||
@@ -104,7 +104,7 @@
|
|||||||
class="border-b border-dashed border-slate-400 text-orange-400 pb-2 mb-2 font-bold uppercase text-sm"
|
class="border-b border-dashed border-slate-400 text-orange-400 pb-2 mb-2 font-bold uppercase text-sm"
|
||||||
v-if="record.jwtId == feedLastViewedId"
|
v-if="record.jwtId == feedLastViewedId"
|
||||||
>
|
>
|
||||||
You've seen all the following before
|
You've seen all the following
|
||||||
</div>
|
</div>
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
<fa icon="gift" class="pt-1 pr-2 text-slate-500"></fa>
|
<fa icon="gift" class="pt-1 pr-2 text-slate-500"></fa>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ importScripts(
|
|||||||
);
|
);
|
||||||
|
|
||||||
self.addEventListener("install", (event) => {
|
self.addEventListener("install", (event) => {
|
||||||
console.error(event);
|
console.error("Adding event listener for:", event);
|
||||||
importScripts(
|
importScripts(
|
||||||
"safari-notifications.js",
|
"safari-notifications.js",
|
||||||
"nacl.js",
|
"nacl.js",
|
||||||
@@ -23,16 +23,20 @@ self.addEventListener("push", function (event) {
|
|||||||
payload = JSON.parse(event.data.text());
|
payload = JSON.parse(event.data.text());
|
||||||
}
|
}
|
||||||
const message = await self.getNotificationCount();
|
const message = await self.getNotificationCount();
|
||||||
console.error(message);
|
if (message) {
|
||||||
const title = payload ? payload.title : "Custom Title";
|
console.log("Will notify user:", message);
|
||||||
const options = {
|
const title = payload ? payload.title : "Custom Title";
|
||||||
body: message,
|
const options = {
|
||||||
icon: payload ? payload.icon : "icon.png",
|
body: message,
|
||||||
badge: payload ? payload.badge : "badge.png",
|
icon: payload ? payload.icon : "icon.png",
|
||||||
};
|
badge: payload ? payload.badge : "badge.png",
|
||||||
await self.registration.showNotification(title, options);
|
};
|
||||||
|
await self.registration.showNotification(title, options);
|
||||||
|
} else {
|
||||||
|
console.log("No notification message, so will not tell the user.");
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error in processing the push event:", error);
|
console.error("Error processing the push event:", error);
|
||||||
}
|
}
|
||||||
})(),
|
})(),
|
||||||
);
|
);
|
||||||
@@ -51,7 +55,7 @@ self.addEventListener("activate", (event) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
self.addEventListener("fetch", (event) => {
|
self.addEventListener("fetch", (event) => {
|
||||||
console.log(event.request);
|
console.log("Got fetch event", event.request);
|
||||||
});
|
});
|
||||||
|
|
||||||
self.addEventListener("error", (event) => {
|
self.addEventListener("error", (event) => {
|
||||||
|
|||||||
@@ -466,6 +466,7 @@ async function getNotificationCount() {
|
|||||||
if ("secret" in self) {
|
if ("secret" in self) {
|
||||||
secret = self.secret;
|
secret = self.secret;
|
||||||
const secretUint8Array = self.decodeBase64(secret);
|
const secretUint8Array = self.decodeBase64(secret);
|
||||||
|
// 1 is our master settings ID; see MASTER_SETTINGS_KEY
|
||||||
const settings = await getSettingById(1);
|
const settings = await getSettingById(1);
|
||||||
let lastNotifiedClaimId = null;
|
let lastNotifiedClaimId = null;
|
||||||
if ("lastNotifiedClaimId" in settings) {
|
if ("lastNotifiedClaimId" in settings) {
|
||||||
@@ -496,7 +497,7 @@ async function getNotificationCount() {
|
|||||||
headers["Authorization"] = "Bearer " + (await accessToken(identifier));
|
headers["Authorization"] = "Bearer " + (await accessToken(identifier));
|
||||||
|
|
||||||
let response = await fetch(
|
let response = await fetch(
|
||||||
"https://test-api.endorser.ch/api/v2/report/claims",
|
settings["apiServer"] + "/api/v2/report/claims",
|
||||||
{
|
{
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: headers,
|
headers: headers,
|
||||||
@@ -513,15 +514,13 @@ async function getNotificationCount() {
|
|||||||
}
|
}
|
||||||
newClaims++;
|
newClaims++;
|
||||||
}
|
}
|
||||||
if (newClaims === 0) {
|
if (newClaims > 0) {
|
||||||
result = "You have no new claims today.";
|
result = `There are ${newClaims} new activities on TimeSafari`;
|
||||||
} else {
|
|
||||||
result = `${newClaims} have been shared with you`;
|
|
||||||
}
|
}
|
||||||
const most_recent_notified = claims[0]["id"];
|
const most_recent_notified = claims[0]["id"];
|
||||||
await setMostRecentNotified(most_recent_notified);
|
await setMostRecentNotified(most_recent_notified);
|
||||||
} else {
|
} else {
|
||||||
console.error(response.status);
|
console.error("The service worker got a bad response status when fetching claims:", response.status, response);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user