refactor(v2): migrate has_snap_welcome_been_shown to v2
Add v2_has_snap_welcome_been_shown as a thin wrapper over the existing UpdatesStore::has_snap_welcome_been_shown(). Update the frontend invoke in updatesService.ts to use the v2 name. Legacy command remains for now. Audit: legacy_callsites 15 -> 14. cc
This commit is contained in:
3 files changed
+9
-1
No files matched your search
@@ -1493,6 +1493,13 @@ pub fn v2_mark_snap_welcome_shown(
|
|||||||
crate::updates::mark_snap_welcome_shown(state)
|
crate::updates::mark_snap_welcome_shown(state)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
pub fn v2_has_snap_welcome_been_shown(
|
||||||
|
state: State<'_, crate::updates::UpdatesState>,
|
||||||
|
) -> Result<bool, String> {
|
||||||
|
crate::updates::has_snap_welcome_been_shown(state)
|
||||||
|
}
|
||||||
|
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
pub async fn v2_detect_legacy_cached_files(
|
pub async fn v2_detect_legacy_cached_files(
|
||||||
cache_state: State<'_, OfflineCacheState>,
|
cache_state: State<'_, OfflineCacheState>,
|
||||||
|
|||||||
@@ -1579,6 +1579,7 @@ pub fn run() {
|
|||||||
commands_v2::v2_is_running_in_flatpak,
|
commands_v2::v2_is_running_in_flatpak,
|
||||||
commands_v2::v2_is_running_in_snap,
|
commands_v2::v2_is_running_in_snap,
|
||||||
commands_v2::v2_mark_snap_welcome_shown,
|
commands_v2::v2_mark_snap_welcome_shown,
|
||||||
|
commands_v2::v2_has_snap_welcome_been_shown,
|
||||||
commands_v2::v2_detect_legacy_cached_files,
|
commands_v2::v2_detect_legacy_cached_files,
|
||||||
commands_v2::v2_reco_log_event,
|
commands_v2::v2_reco_log_event,
|
||||||
commands_v2::v2_reco_train_scores,
|
commands_v2::v2_reco_train_scores,
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ async function shouldShowSnapWelcome(): Promise<boolean> {
|
|||||||
try {
|
try {
|
||||||
const isSnap = await invoke<boolean>('v2_is_running_in_snap');
|
const isSnap = await invoke<boolean>('v2_is_running_in_snap');
|
||||||
if (!isSnap) return false;
|
if (!isSnap) return false;
|
||||||
const alreadyShown = await invoke<boolean>('has_snap_welcome_been_shown');
|
const alreadyShown = await invoke<boolean>('v2_has_snap_welcome_been_shown');
|
||||||
return !alreadyShown;
|
return !alreadyShown;
|
||||||
} catch {
|
} catch {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in new issue
Block a user