Detect when QBZ runs inside a Snap sandbox (via SNAP env var) and show a one-time welcome modal with required plug connection commands. Adds a Snap Sandbox section in Settings with copyable commands, mirroring the existing Flatpak pattern. Backend: snap.rs module, DB table snap_welcome_shown, V2 commands. Frontend: updatesService, +page.svelte modal queue, SettingsView section.
17 lines
340 B
Rust
17 lines
340 B
Rust
//! Snap runtime detection and utilities
|
|
//!
|
|
//! Detects when QBZ is running inside a Snap sandbox
|
|
//! and provides sandbox-specific guidance.
|
|
|
|
use std::env;
|
|
|
|
/// Check if QBZ is running inside a Snap sandbox
|
|
pub fn is_snap() -> bool {
|
|
env::var("SNAP").is_ok()
|
|
}
|
|
|
|
#[tauri::command]
|
|
pub fn is_running_in_snap() -> bool {
|
|
is_snap()
|
|
}
|