mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-21 04:38:11 +08:00
Implement IndexedDB document auto-save (#422)
* removed all use of document indicies * -add u64 support for wasm bridge * fixed rust formating * Cleaned up FrontendDocumentState in js-messages * Tiny tweaks from code review * - moved more of closeDocumentWithConfirmation to rust - updated serde_wasm_bindgen to add feature flag * working initial auto save impl * auto save is a lifetime file * - cargo fmt - fixc error message - move document version constant * code review round 1 * generate seed for uuid in js when wasm is initialized * Resolve PR feedback * Further address PR feedback * Fix failing test Co-authored-by: Keavon Chambers <keavon@keavon.com> Co-authored-by: otdavies <oliver@psyfer.io>
This commit is contained in:
committed by
Keavon Chambers
co-authored by
Keavon Chambers
otdavies
parent
ff39ebfdbb
commit
c9f140f458
@@ -1,3 +1,4 @@
|
||||
use crate::consts::GRAPHENE_DOCUMENT_VERSION;
|
||||
use std::{
|
||||
cmp::max,
|
||||
collections::hash_map::DefaultHasher,
|
||||
@@ -19,6 +20,7 @@ pub struct Document {
|
||||
/// This identifier is not a hash and is not guaranteed to be equal for equivalent documents.
|
||||
#[serde(skip)]
|
||||
pub state_identifier: DefaultHasher,
|
||||
pub graphene_document_version: String,
|
||||
}
|
||||
|
||||
impl Default for Document {
|
||||
@@ -26,6 +28,7 @@ impl Default for Document {
|
||||
Self {
|
||||
root: Layer::new(LayerDataType::Folder(Folder::default()), DAffine2::IDENTITY.to_cols_array()),
|
||||
state_identifier: DefaultHasher::new(),
|
||||
graphene_document_version: GRAPHENE_DOCUMENT_VERSION.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user