add note to install as an app

This commit is contained in:
2023-12-27 14:46:10 -07:00
parent 051a0a97d8
commit 75d15ddeb9
4 changed files with 33 additions and 12 deletions

View File

@@ -275,7 +275,6 @@ export default class DiscoverView extends Vue {
const results = await response.json();
const plans: ProjectData[] = results.data;
console.log("Got plans:", plans);
if (plans) {
for (const plan of plans) {
const { name, description, handleId, issuerDid, rowid } = plan;

View File

@@ -79,8 +79,9 @@
</p>
<p>
If you installed the app with Chrome, make sure there are no other
tabs with it open; then here are some ways to clear caches that can
mess things up:
tabs with it open. Here are some ways to clear caches that can mess
things up (and note that this clears out data from the installed app
-- which is good to do while the app is installed):
</p>
<ul>
<li class="list-disc ml-4">

View File

@@ -10,6 +10,21 @@
<!-- show the actions for recognizing a give -->
<div class="mb-8">
<div
v-if="!isInstalled()"
class="bg-amber-200 rounded-md overflow-hidden text-center px-4 py-3 mb-4"
>
<p>
You should install this as an app.
<router-link
:to="{ name: 'help-notifications' }"
class="text-blue-500"
>
Go here for instructions.
</router-link>
</p>
</div>
<div
v-if="!activeDid"
class="bg-amber-200 rounded-md overflow-hidden text-center px-4 py-3 mb-4"
@@ -249,6 +264,18 @@ export default class HomeView extends Vue {
}
}
// from https://benborgers.com/posts/pwa-detect-installed
isInstalled() {
// For iOS
if ("standalone" in window.navigator) return true;
// For Android
if (window.matchMedia("(display-mode: standalone)").matches) return true;
// If neither is true, it's not installed
return false;
}
public async buildHeaders() {
const headers: HeadersInit = {
"Content-Type": "application/json",