Introduction revamp.

This commit is contained in:
Michael Mainguy 2024-04-24 07:50:26 -05:00
parent fbc39f2103
commit cfe174d564
4 changed files with 17 additions and 3279 deletions

View File

@ -3,7 +3,7 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1" name="viewport"/> <meta content="width=device-width, initial-scale=1" name="viewport"/>
<meta content="An immersive vr diagramming experience based using webxr version 0.1" name="description"> <meta content="An immersive vr diagramming experience based using webxr version 0.2" name="description">
<meta content="width=device-width, initial-scale=1, height=device-height" name="viewport"> <meta content="width=device-width, initial-scale=1, height=device-height" name="viewport">
<link href="/styles.css" rel="stylesheet"> <link href="/styles.css" rel="stylesheet">
<link href="/assets/favicon-32x32.png" rel="icon" sizes="32x32" type="image/png"> <link href="/assets/favicon-32x32.png" rel="icon" sizes="32x32" type="image/png">

3275
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,7 @@
{ {
"name": "immersive", "name": "immersive",
"private": true, "private": true,
"version": "0.0.1", "version": "0.0.2 d",
"type": "module", "type": "module",
"engines": { "engines": {
"node": ">=18.0.0" "node": ">=18.0.0"
@ -34,7 +34,7 @@
"@types/react": "^18.2.72", "@types/react": "^18.2.72",
"@types/react-dom": "^18.2.22", "@types/react-dom": "^18.2.22",
"axios": "^1.6.8", "axios": "^1.6.8",
"babylon-html": "0.0.3", "babylon-html": "^0.0.3",
"dom-to-image-more": "^3.3.0", "dom-to-image-more": "^3.3.0",
"earcut": "^2.2.4", "earcut": "^2.2.4",
"events": "^3.3.0", "events": "^3.3.0",

View File

@ -6,6 +6,7 @@ import {DiagramEventObserverMask, DiagramManager} from "../diagram/diagramManage
import log, {Logger} from "loglevel"; import log, {Logger} from "loglevel";
import {ascii_to_hex} from "./functions/hexFunctions"; import {ascii_to_hex} from "./functions/hexFunctions";
import {getPath} from "../util/functions/getPath"; import {getPath} from "../util/functions/getPath";
import {v4 as uuidv4} from 'uuid';
const logger: Logger = log.getLogger('PouchdbPersistenceManager'); const logger: Logger = log.getLogger('PouchdbPersistenceManager');
export class PouchdbPersistenceManager { export class PouchdbPersistenceManager {
@ -96,7 +97,19 @@ export class PouchdbPersistenceManager {
private async initLocal(): Promise<boolean> { private async initLocal(): Promise<boolean> {
try { try {
let current = getPath() || 'public'; let current = getPath();
if (!current) {
const locallyStored = localStorage.getItem('currentDiagram');
if (!locallyStored) {
const newId = uuidv4().replaceAll('-', '_');
localStorage.setItem('currentDiagram', newId);
window.history.replaceState(null, null, '/db/' + newId);
current = newId;
} else {
current = locallyStored;
window.history.replaceState(null, null, '/db/' + current);
}
}
this.db = new PouchDB(current); this.db = new PouchDB(current);
await this.beginSync(current); await this.beginSync(current);
return true; return true;