Skip to content

Commit

Permalink
fix: only enable log plugin in production -- avoid inconsistent issue…
Browse files Browse the repository at this point in the history
… where app crashes due to log plugin being initialized twice on app un-pause
  • Loading branch information
mattyg committed Oct 22, 2024
1 parent 924dcd0 commit 81fffc0
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ pub fn run() {
.plugin(tauri_plugin_notification::init())
.plugin(tauri_plugin_clipboard_manager::init())
.plugin(tauri_plugin_os::init())
.plugin(
tauri_plugin_log::Builder::default()
.level(log::LevelFilter::Warn)
.build(),
)
.plugin(tauri_plugin_holochain::async_init(
vec_to_locked(vec![]).expect("Can't build passphrase"),
HolochainPluginConfig {
Expand All @@ -42,6 +37,19 @@ pub fn run() {
{
builder = builder.plugin(tauri_plugin_sharesheet::init());
}

// Only enable logging in dev mode
// to avoid inconsistent issue where app crashes when unpaused
// due to the log plugin being initialized twice
// TODO: When bug is resolved, re-enable this plugin in production mode
if tauri::is_dev() {
builder = builder.plugin(
tauri_plugin_log::Builder::default()
.level(log::LevelFilter::Warn)
.build(),
)
}

builder
.setup(|app| {
let handle = app.handle().clone();
Expand Down

0 comments on commit 81fffc0

Please sign in to comment.