Create push notificaiton token dir

This commit is contained in:
QuantumEntangledAndy committed 2024-05-02 10:57:00 +07:00
1 parent 0d5fbd30f1
commit 8f043a3ce2
1 file changed
+25
+25
View File
@@ -74,6 +74,31 @@ impl PushNotiThread {
// let vapid_key = "????";
let token_path = dirs::config_dir().map(|mut d| {
fs::create_dir(&d)
.map_or_else(
|res| {
if let std::io::ErrorKind::AlreadyExists = res.kind() {
Ok(())
} else {
Err(res)
}
},
Ok,
)
.expect("Unable to create directory for push notification settings: {d:?}");
d.push("neolink");
fs::create_dir(&d)
.map_or_else(
|res| {
if let std::io::ErrorKind::AlreadyExists = res.kind() {
Ok(())
} else {
Err(res)
}
},
Ok,
)
.expect("Unable to create directory for push notification settings: {d:?}");
d.push("./neolink_token.toml");
d
});