mirror of
https://github.com/hoornet/vega.git
synced 2026-07-20 15:28:12 -07:00
Bump to v0.7.0 — writer tools, NIP-98 uploads, multi-draft, article bookmarks
- NIP-98 HTTP Auth for image uploads with fallback services (void.cat, nostrimg.com) - Markdown toolbar (bold, italic, heading, link, image, quote, code, list) + Ctrl+B/I/K - Multi-draft management with draft list, resume, delete, auto-migrate - Cover image file picker in article meta panel - Article bookmarks via NIP-51 'a' tags; Notes/Articles tabs in BookmarkView - Removed Rust upload_file command; dropped reqwest/mime_guess deps - Upload spinner, draft count badge, empty states
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "wrystr"
|
||||
version = "0.6.1"
|
||||
version = "0.7.0"
|
||||
description = "Cross-platform Nostr desktop client with Lightning integration"
|
||||
authors = ["hoornet"]
|
||||
edition = "2021"
|
||||
@@ -29,6 +29,4 @@ rusqlite = { version = "0.32", features = ["bundled"] }
|
||||
tauri-plugin-http = "2.5.7"
|
||||
tauri-plugin-dialog = "2.6.0"
|
||||
tauri-plugin-fs = "2.4.5"
|
||||
reqwest = { version = "0.13.2", default-features = false, features = ["multipart", "rustls"] }
|
||||
mime_guess = "2.0.5"
|
||||
|
||||
|
||||
@@ -37,51 +37,6 @@ fn delete_nsec(pubkey: String) -> Result<(), String> {
|
||||
}
|
||||
}
|
||||
|
||||
// ── File upload ─────────────────────────────────────────────────────────────
|
||||
|
||||
#[tauri::command]
|
||||
async fn upload_file(path: String) -> Result<String, String> {
|
||||
let file_bytes = std::fs::read(&path).map_err(|e| format!("Failed to read file: {e}"))?;
|
||||
let file_name = std::path::Path::new(&path)
|
||||
.file_name()
|
||||
.and_then(|n| n.to_str())
|
||||
.unwrap_or("file")
|
||||
.to_string();
|
||||
let mime = mime_guess::from_path(&path)
|
||||
.first_or_octet_stream()
|
||||
.to_string();
|
||||
|
||||
let part = reqwest::multipart::Part::bytes(file_bytes)
|
||||
.file_name(file_name)
|
||||
.mime_str(&mime)
|
||||
.map_err(|e| format!("MIME error: {e}"))?;
|
||||
let form = reqwest::multipart::Form::new().part("file", part);
|
||||
|
||||
let client = reqwest::Client::new();
|
||||
let resp = client
|
||||
.post("https://nostr.build/api/v2/upload/files")
|
||||
.multipart(form)
|
||||
.send()
|
||||
.await
|
||||
.map_err(|e| format!("Upload request failed: {e}"))?;
|
||||
|
||||
if !resp.status().is_success() {
|
||||
return Err(format!("Upload failed (HTTP {})", resp.status()));
|
||||
}
|
||||
|
||||
let data: serde_json::Value = resp
|
||||
.json()
|
||||
.await
|
||||
.map_err(|e| format!("Failed to parse response: {e}"))?;
|
||||
|
||||
if data["status"] == "success" {
|
||||
if let Some(url) = data["data"][0]["url"].as_str() {
|
||||
return Ok(url.to_string());
|
||||
}
|
||||
}
|
||||
Err(data["message"].as_str().unwrap_or("Upload failed — no URL returned").to_string())
|
||||
}
|
||||
|
||||
// ── SQLite note/profile cache ────────────────────────────────────────────────
|
||||
|
||||
struct DbState(Mutex<Connection>);
|
||||
@@ -250,7 +205,6 @@ pub fn run() {
|
||||
store_nsec,
|
||||
load_nsec,
|
||||
delete_nsec,
|
||||
upload_file,
|
||||
db_save_notes,
|
||||
db_load_feed,
|
||||
db_save_profile,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Wrystr",
|
||||
"version": "0.6.1",
|
||||
"version": "0.7.0",
|
||||
"identifier": "com.hoornet.wrystr",
|
||||
"build": {
|
||||
"beforeDevCommand": "npm run dev",
|
||||
|
||||
Reference in New Issue
Block a user