mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-31 13:39:36 +02:00
feat(notifications): use the ligh windows-version crate (#750)
* feat(notifications): use the ligh `windows-version` crate * Update desktop.rs * optional
This commit is contained in:
@@ -32,6 +32,7 @@ notify-rust = "4.5"
|
||||
|
||||
[target."cfg(windows)".dependencies]
|
||||
win7-notifications = { version = "0.3.1", optional = true }
|
||||
windows-version = { version = "0.1", optional = true }
|
||||
|
||||
[features]
|
||||
windows7-compat = [ "win7-notifications" ]
|
||||
windows7-compat = [ "win7-notifications", "windows-version" ]
|
||||
|
||||
@@ -226,7 +226,13 @@ mod imp {
|
||||
pub fn notify<R: tauri::Runtime>(self, app: &tauri::AppHandle<R>) -> crate::Result<()> {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
if tauri::utils::platform::is_windows_7() {
|
||||
fn is_windows_7() -> bool {
|
||||
let v = windows_version::OsVersion::current();
|
||||
// windows 7 is 6.1
|
||||
v.major == 6 && v.minor == 1
|
||||
}
|
||||
|
||||
if is_windows_7() {
|
||||
self.notify_win7(app)
|
||||
} else {
|
||||
#[allow(deprecated)]
|
||||
|
||||
Reference in New Issue
Block a user