Skip to content

Commit

Permalink
Remove local storage
Browse files Browse the repository at this point in the history
  • Loading branch information
benthecarman committed Oct 16, 2023
1 parent e5c2f4e commit 23d49c0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mutiny-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ js-sys = { version = "0.3.60" }
gloo-net = { version = "0.2.4" }
instant = { version = "0.1", features = ["wasm-bindgen"] }
getrandom = { version = "0.2", features = ["js"] }
windowless_sleep = { git = "https://github.com/futurepaul/windowless_sleep", commit = "e924649" }
windowless_sleep = { git = "https://github.com/futurepaul/windowless_sleep", rev = "e924649" }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
web-sys = { version = "0.3.60", features = ["console"] }
Expand Down
5 changes: 3 additions & 2 deletions mutiny-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ bip39 = { version = "2.0.0" }
getrandom = { version = "0.2", features = ["js"] }
futures = "0.3.25"
urlencoding = "2.1.2"
windowless_sleep = { git = "https://github.com/futurepaul/windowless_sleep", commit = "e924649" }
windowless_sleep = { git = "https://github.com/futurepaul/windowless_sleep", rev = "e924649" }

# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
Expand All @@ -54,7 +54,8 @@ wasm-bindgen-test = "0.3.33"
web-sys = { version = "0.3.60", features = ["console"] }

[features]
default = [ ]
default = []
service-worker = []

[package.metadata.wasm-pack.profile.release]
wasm-opt = true
8 changes: 6 additions & 2 deletions mutiny-wasm/src/indexed_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,8 +486,12 @@ fn used_once(key: &str) -> bool {
/// This is because indexed db is not always reliable.
///
/// We need to do this for the channel manager and channel monitors.
fn write_to_local_storage(key: &str) -> bool {
match key {
fn write_to_local_storage(_key: &str) -> bool {
#[cfg(feature = "service-worker")]
{
return false;
}
match _key {
str if str.starts_with(CHANNEL_MANAGER_KEY) => true,
str if str.starts_with(MONITORS_PREFIX_KEY) => true,
_ => false,
Expand Down

0 comments on commit 23d49c0

Please sign in to comment.