forked from tools/josh
Avoid unnecessary /nav API call
This commit is contained in:
parent
71ba3686f9
commit
e152eb2ad4
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "fwdekker.com",
|
"name": "fwdekker.com",
|
||||||
"version": "0.39.16",
|
"version": "0.39.17",
|
||||||
"description": "The source code of [my personal website](https://fwdekker.com/).",
|
"description": "The source code of [my personal website](https://fwdekker.com/).",
|
||||||
"author": "Felix W. Dekker",
|
"author": "Felix W. Dekker",
|
||||||
"browser": "dist/bundle.js",
|
"browser": "dist/bundle.js",
|
||||||
|
|
|
@ -60,6 +60,7 @@ addOnLoad(() => {
|
||||||
* Initializes the application.
|
* Initializes the application.
|
||||||
*/
|
*/
|
||||||
addOnLoad(async () => {
|
addOnLoad(async () => {
|
||||||
|
if (!Persistence.hasFileSystem())
|
||||||
await FileSystem.loadNavApi();
|
await FileSystem.loadNavApi();
|
||||||
|
|
||||||
window.terminal = new Terminal(
|
window.terminal = new Terminal(
|
||||||
|
|
|
@ -26,6 +26,15 @@ export class Persistence {
|
||||||
/// Long-term storage
|
/// Long-term storage
|
||||||
///
|
///
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns true if and only if a file system is stored in the persistent storage.
|
||||||
|
*
|
||||||
|
* @return true if and only if a file system is stored in the persistent storage
|
||||||
|
*/
|
||||||
|
static hasFileSystem(): boolean {
|
||||||
|
return localStorage.getItem("//files") !== null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deserializes a file system from persistent storage, or returns the default file system if the deserialization
|
* Deserializes a file system from persistent storage, or returns the default file system if the deserialization
|
||||||
* failed.
|
* failed.
|
||||||
|
|
Loading…
Reference in New Issue