This commit is contained in:
Jonas Braus committed 2026-11-04 23:16:38 +01:00
1 parent 206ed00935
commit 06304dfc7d
6 files changed
+33 -6

No files matched your search

+6 -1
View File
@@ -1,4 +1,6 @@
use rusqlite::Connection;
use std::{env, path::PathBuf};
use std::fs;
#[path = "note.rs"]
mod note;
@@ -6,7 +8,10 @@ use note::Note;
#[tauri::command]
pub fn get_notes_list(search: &str) -> Vec<Note> {
let conn = Connection::open("notes.db").expect("Failed to open database");
let app_dir = PathBuf::from(env::var("HOME").unwrap_or_else(|_| ".".into()))
.join(".notesapp");
fs::create_dir_all(&app_dir).expect("Failed to create app dir");
let conn = Connection::open(app_dir.join("notes.db")).expect("Failed to open database");
conn.execute(
"CREATE TABLE IF NOT EXISTS notes
+1 -1
View File
@@ -1,4 +1,4 @@
#[derive(serde::Serialize)]
#[derive(serde::Serialize)]
pub struct Note {
pub id: u32,
pub title: String,
+1 -1
View File
@@ -12,7 +12,7 @@
{
"title": "Notes",
"transparent": true,
"width": 950,
"width": 1100,
"height": 600,
"minWidth": 800,
"minHeight": 500