fix(desktop): hide in-app updater when installed via a system package manager

This commit is contained in:
KhooLy 2026-07-28 15:43:50 +03:00
parent a0b9b5d14d
commit c55e40fdbc
4 changed files with 28 additions and 1 deletions

View file

@ -703,6 +703,18 @@ fn player_hdr_supported(app: tauri::AppHandle) -> bool {
}
}
#[tauri::command]
fn in_app_updates_supported() -> bool {
#[cfg(target_os = "linux")]
{
std::env::var_os("APPIMAGE").is_some()
}
#[cfg(not(target_os = "linux"))]
{
true
}
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
let _sentry_guard = sentry::init(sentry::ClientOptions {
@ -1013,6 +1025,7 @@ pub fn run() {
anilist_oauth_exchange,
simkl_oauth_exchange,
get_data_dir,
in_app_updates_supported,
set_download_dir,
list_offline_downloads,
delete_offline_download,

View file

@ -693,6 +693,7 @@
"settings.hold_speed_desc": "Playback speed used while holding the screen.",
"settings.advanced": "ADVANCED",
"settings.check_for_updates": "Check for updates",
"settings.updates_managed_by_package_manager": "Updates are managed by your package manager",
"settings.check_for_updates_desc": "Version information and update controls.",
"settings.developer": "Developer",
"settings.developer_desc": "Developer options and diagnostic tools.",

View file

@ -693,6 +693,7 @@
"settings.hold_speed_desc": "Ekrana basılı tutulduğunda kullanılacak oynatma hızı.",
"settings.advanced": "ADVANCED",
"settings.check_for_updates": "Güncellemeleri kontrol et",
"settings.updates_managed_by_package_manager": "Güncellemeler paket yöneticiniz tarafından yönetiliyor",
"settings.check_for_updates_desc": "Sürüm bilgileri ve güncelleme kontrolleri.",
"settings.developer": "Geliştirici",
"settings.developer_desc": "Geliştirici seçenekleri ve tanı araçları.",

View file

@ -120,6 +120,11 @@ export function SettingsScreen({ state, onDispatch, activeProfile, onProfileUpda
const [addedAddonName, setAddedAddonName] = useState<string | null>(null);
const [pluginInstallLoading, setPluginInstallLoading] = useState(false);
const [pluginInstallError, setPluginInstallError] = useState<string | null>(null);
const [inAppUpdatesSupported, setInAppUpdatesSupported] = useState(true);
useEffect(() => {
invoke<boolean>('in_app_updates_supported').then(setInAppUpdatesSupported).catch(() => undefined);
}, []);
useEffect(() => {
storageRead<Prefs>('prefs').then((p) => {
@ -406,7 +411,14 @@ export function SettingsScreen({ state, onDispatch, activeProfile, onProfileUpda
<div style={{ flex: 1 }} />
<SidebarDivider />
<div style={{ display: 'flex', flexDirection: 'column', gap: '0.125rem' }}>
<SidebarItem label={t('settings.check_for_updates') || 'Check for updates'} subtitle="" icon={<RefreshIcon />} selected={false} onClick={onCheckForUpdates} />
{inAppUpdatesSupported ? (
<SidebarItem label={t('settings.check_for_updates') || 'Check for updates'} subtitle="" icon={<RefreshIcon />} selected={false} onClick={onCheckForUpdates} />
) : (
<div style={{ padding: '0.5625rem 0.75rem', display: 'flex', alignItems: 'center', gap: '0.625rem' }}>
<RefreshIcon />
<span style={{ color: 'rgba(255,255,255,0.4)', fontSize: '0.8125rem' }}>{t('settings.updates_managed_by_package_manager')}</span>
</div>
)}
<SidebarItem label={t('common.back')} subtitle="" icon={<ArrowBackIcon />} selected={false} onClick={onBack} />
</div>
<VersionFooter />