feat: starting page

This commit is contained in:
electria 2026-08-25 19:43:14 -07:00
commit e4ddc86caf
Signed by: electria
SSH key fingerprint: SHA256:8LlB3ucPbBHqozqkhsNbaV5oG3SlzzqUj8FZDL6IPQs
6 changed files with 674 additions and 14 deletions

26
src/db.rs Normal file
View file

@ -0,0 +1,26 @@
use std::{fs, io};
pub fn get_last_opened() -> io::Result<String> {
Ok(fs::read_to_string(
dirs::data_dir()
.ok_or(io::Error::new(
io::ErrorKind::NotFound,
"unable to find data_dir",
))?
.join("keepice.txt"),
)?)
}
pub fn set_last_opened(path: impl AsRef<str>) -> io::Result<()> {
fs::write(
dirs::data_dir()
.ok_or(io::Error::new(
io::ErrorKind::NotFound,
"unable to find data_dir",
))?
.join("keepice.txt"),
path.as_ref(),
)?;
Ok(())
}