chore: bump version

This commit is contained in:
2024-08-30 13:30:29 +07:00
parent e06b0334a5
commit 2eab6f04c7
15 changed files with 8335 additions and 6216 deletions

View File

@@ -44,7 +44,7 @@ pub async fn create_account(
let client = &state.client;
let keys = Keys::generate();
let npub = keys.public_key().to_bech32().map_err(|e| e.to_string())?;
let secret_key = keys.secret_key().map_err(|e| e.to_string())?;
let secret_key = keys.secret_key();
let enc = EncryptedSecretKey::new(secret_key, password, 16, KeySecurity::Medium)
.map_err(|err| err.to_string())?;
let enc_bech32 = enc.to_bech32().map_err(|err| err.to_string())?;
@@ -127,7 +127,7 @@ pub async fn connect_account(uri: String, state: State<'_, Nostr>) -> Result<Str
Ok(bunker_uri) => {
// Local user
let app_keys = Keys::generate();
let app_secret = app_keys.secret_key().unwrap().to_string();
let app_secret = app_keys.secret_key().to_string();
// Get remote user
let remote_user = bunker_uri.signer_public_key().unwrap();

View File

@@ -206,7 +206,7 @@ pub async fn set_lume_store(
let public_key = signer.public_key().await.map_err(|e| e.to_string())?;
let encrypted = signer
.nip44_encrypt(public_key, content)
.nip44_encrypt(&public_key, content)
.await
.map_err(|e| e.to_string())?;
let tag = Tag::identifier(key);
@@ -237,7 +237,7 @@ pub async fn get_lume_store(key: String, state: State<'_, Nostr>) -> Result<Stri
{
Ok(events) => {
if let Some(event) = get_latest_event(&events) {
match signer.nip44_decrypt(public_key, event.content()).await {
match signer.nip44_decrypt(&public_key, &event.content).await {
Ok(decrypted) => Ok(decrypted),
Err(_) => Err(event.content.to_string()),
}
@@ -522,7 +522,7 @@ pub async fn set_settings(
let signer = client.signer().await.map_err(|e| e.to_string())?;
let public_key = signer.public_key().await.map_err(|e| e.to_string())?;
let encrypted = signer
.nip44_encrypt(public_key, settings)
.nip44_encrypt(&public_key, settings)
.await
.map_err(|e| e.to_string())?;
let tag = Tag::identifier(ident);

View File

@@ -329,8 +329,7 @@ pub async fn get_user_settings(client: &Client) -> Result<Settings, String> {
{
Ok(events) => {
if let Some(event) = events.first() {
let content = event.content();
match signer.nip44_decrypt(public_key, content).await {
match signer.nip44_decrypt(&public_key, &event.content).await {
Ok(decrypted) => match serde_json::from_str(&decrypted) {
Ok(parsed) => Ok(parsed),
Err(_) => Err("Could not parse settings payload".into()),

View File

@@ -156,8 +156,6 @@ fn main() {
#[cfg(not(target_os = "macos"))]
let tauri_builder = tauri::Builder::default();
let mut ctx = tauri::generate_context!();
tauri_builder
.invoke_handler(builder.invoke_handler())
.setup(move |app| {
@@ -364,7 +362,6 @@ fn main() {
Ok(())
})
.plugin(prevent_default())
.plugin(tauri_plugin_theme::init(ctx.config_mut()))
.plugin(tauri_plugin_decorum::init())
.plugin(tauri_plugin_store::Builder::default().build())
.plugin(tauri_plugin_clipboard_manager::init())
@@ -377,7 +374,7 @@ fn main() {
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_upload::init())
.plugin(tauri_plugin_updater::Builder::new().build())
.run(ctx)
.run(tauri::generate_context!())
.expect("error while running tauri application");
}