Skip to content

Commit 1091bd0

Browse files
committed
draft fields for media upload feat
Signed-off-by: kernelkind <[email protected]>
1 parent b1aaeec commit 1091bd0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

crates/notedeck_columns/src/draft.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
use crate::ui::note::PostType;
1+
use poll_promise::Promise;
2+
3+
use crate::{media_upload::Nip94Event, ui::note::PostType, Error};
24
use std::collections::HashMap;
35

46
#[derive(Default)]
57
pub struct Draft {
68
pub buffer: String,
9+
pub uploaded_media: Vec<Nip94Event>, // media uploads to include
10+
pub uploading_media: Vec<Promise<Result<Nip94Event, Error>>>, // promises that aren't ready yet
11+
pub upload_errors: Vec<String>, // media upload errors to show the user
712
}
813

914
#[derive(Default)]
@@ -42,5 +47,8 @@ impl Draft {
4247

4348
pub fn clear(&mut self) {
4449
self.buffer = "".to_string();
50+
self.upload_errors = Vec::new();
51+
self.uploaded_media = Vec::new();
52+
self.uploading_media = Vec::new();
4553
}
4654
}

0 commit comments

Comments
 (0)