Introduction revamp.
This commit is contained in:
parent
fbc39f2103
commit
cfe174d564
@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<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">
|
||||
<link href="/styles.css" rel="stylesheet">
|
||||
<link href="/assets/favicon-32x32.png" rel="icon" sizes="32x32" type="image/png">
|
||||
|
||||
3275
package-lock.json
generated
3275
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "immersive",
|
||||
"private": true,
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2 d",
|
||||
"type": "module",
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
@ -34,7 +34,7 @@
|
||||
"@types/react": "^18.2.72",
|
||||
"@types/react-dom": "^18.2.22",
|
||||
"axios": "^1.6.8",
|
||||
"babylon-html": "0.0.3",
|
||||
"babylon-html": "^0.0.3",
|
||||
"dom-to-image-more": "^3.3.0",
|
||||
"earcut": "^2.2.4",
|
||||
"events": "^3.3.0",
|
||||
|
||||
@ -6,6 +6,7 @@ import {DiagramEventObserverMask, DiagramManager} from "../diagram/diagramManage
|
||||
import log, {Logger} from "loglevel";
|
||||
import {ascii_to_hex} from "./functions/hexFunctions";
|
||||
import {getPath} from "../util/functions/getPath";
|
||||
import {v4 as uuidv4} from 'uuid';
|
||||
|
||||
const logger: Logger = log.getLogger('PouchdbPersistenceManager');
|
||||
export class PouchdbPersistenceManager {
|
||||
@ -96,7 +97,19 @@ export class PouchdbPersistenceManager {
|
||||
|
||||
private async initLocal(): Promise<boolean> {
|
||||
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);
|
||||
await this.beginSync(current);
|
||||
return true;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user