Remove GRAPHITE_DOCUMENT_VERSION

This commit is contained in:
Keavon Chambers
2024-01-06 17:25:05 -08:00
parent 121c1d2b9d
commit 7998947202
10 changed files with 8 additions and 45 deletions
-6
View File
@@ -51,13 +51,7 @@ export function createPersistenceManager(editor: Editor, portfolio: PortfolioSta
const orderedSavedDocuments = documentOrder.flatMap((id) => (previouslySavedDocuments[id] ? [previouslySavedDocuments[id]] : []));
const currentDocumentVersion = editor.instance.graphiteDocumentVersion();
orderedSavedDocuments?.forEach(async (doc: TriggerIndexedDbWriteDocument) => {
if (doc.version !== currentDocumentVersion) {
await removeDocument(doc.details.id);
return;
}
editor.instance.openAutoSavedDocument(BigInt(doc.details.id), doc.details.name, doc.details.isSaved, doc.document);
});
}
+1 -7
View File
@@ -10,7 +10,7 @@ use crate::{Error, EDITOR_HAS_CRASHED, EDITOR_INSTANCES, JS_EDITOR_HANDLES};
use editor::application::generate_uuid;
use editor::application::Editor;
use editor::consts::{FILE_SAVE_SUFFIX, GRAPHITE_DOCUMENT_VERSION};
use editor::consts::FILE_SAVE_SUFFIX;
use editor::messages::input_mapper::utility_types::input_keyboard::ModifierKeys;
use editor::messages::input_mapper::utility_types::input_mouse::{EditorMouseState, ScrollDelta, ViewportBounds};
use editor::messages::portfolio::document::utility_types::document_metadata::LayerNodeIdentifier;
@@ -270,12 +270,6 @@ impl JsEditorHandle {
FILE_SAVE_SUFFIX.into()
}
/// Get the constant `GRAPHITE_DOCUMENT_VERSION`
#[wasm_bindgen(js_name = graphiteDocumentVersion)]
pub fn graphite_document_version(&self) -> String {
GRAPHITE_DOCUMENT_VERSION.to_string()
}
/// Update layout of a given UI
#[wasm_bindgen(js_name = updateLayout)]
pub fn update_layout(&self, layout_target: JsValue, widget_id: u64, value: JsValue) -> Result<(), JsValue> {