[ui] mark each visited entity with a LAST_VISITED timestamp

feat/vaults
Tomáš Mládek 2022-02-02 17:58:53 +01:00
parent d5337bd784
commit 6bb3fe1788
No known key found for this signature in database
GPG Key ID: ED21612889E75EC5
1 changed files with 10 additions and 2 deletions

View File

@ -4,7 +4,7 @@
import UpObject from "./display/UpObject.svelte";
import { UpType } from "../lib/types";
import BlobPreview from "./display/BlobPreview.svelte";
import { setContext } from "svelte";
import { onMount, setContext } from "svelte";
import { writable } from "svelte/store";
import type { UpEntry } from "upend";
import Spinner from "./utils/Spinner.svelte";
@ -86,7 +86,7 @@
}
$: filteredUntypedAttributes = untypedAttributes.filter(
(entry) => !["IS", "LBL", "NOTE"].includes(entry.attribute)
(entry) => !["IS", "LBL", "NOTE", "LAST_VISITED"].includes(entry.attribute)
);
$: currentUntypedAttributes = editable
@ -161,6 +161,14 @@
await fetch(`/api/obj/${address}`, { method: "DELETE" });
revalidate();
}
onMount(() => {
fetch(`/api/obj/${address}/LAST_VISITED`, {
method: "PUT",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ t: "Number", c: new Date().getTime() }),
});
});
</script>
<div class="inspect">