Onboarding live apps without owner questions for what the stores and the code prove: storebound onboard imports the live products and subscriptions with USD / base prices (catalog diff clean), contact values, the App Review contact and demo account (credentials.json, masked), sign-in for review from Apple's review detail and auth code, and the account deletion page from the app's site; App Store keywords count characters (live fields up to 265 bytes accepted); validate accepts the 6.5-inch iPhone set and Play's default-language graphics fallback; Play Reporting API off gives the project's enable link and apps list falls back to local apps; accounts default <profile>; store-only apps (apps add --store --app-id) shown read-only in the desktop (pitfalls 43-52)
This commit is contained in:
parent
d2ce185441
commit
e5f148e534
55 changed files with 1648 additions and 158 deletions
|
|
@ -1091,9 +1091,21 @@ pub async fn store_apps_refresh(window: WebviewWindow, app: AppHandle, state: St
|
|||
let value = r.call_job("apps.list", json!({ "credentials": creds, "args": { "icons": icons } }), job.as_deref()).await?;
|
||||
let at = store::now_iso();
|
||||
state.cache.put(&format!("acct:{id}"), "apps.list", &json!({}), &value, &at).map_err(Fail::host)?;
|
||||
let st = saved(&state)?;
|
||||
let value = match st.accounts.iter().find(|a| a.id == id) {
|
||||
Some(a) => store_only_into(&st.accounts, a, Some(value.clone()), ®istry::read_store_apps(&state.registry), &at).unwrap_or(value),
|
||||
None => value,
|
||||
};
|
||||
Ok(Entry { value, at })
|
||||
}
|
||||
|
||||
/// One account's app list with the machine's store-only apps of its credential profile added (registry.rs).
|
||||
fn store_only_into(all: &[Account], a: &Account, list: Option<Value>, apps: &[registry::StoreOnly], at: &str) -> Option<Value> {
|
||||
let store = match a.kind { AccountKind::Apple => "apple", AccountKind::Play => "play" };
|
||||
let only = all.iter().filter(|x| x.kind == a.kind).count() == 1;
|
||||
registry::with_store_only(list, store, a.profile.as_deref(), only, apps, at)
|
||||
}
|
||||
|
||||
#[derive(Serialize)]
|
||||
pub struct AccountApps {
|
||||
account: String,
|
||||
|
|
@ -1104,11 +1116,19 @@ pub struct AccountApps {
|
|||
#[tauri::command]
|
||||
pub fn store_apps_cached(window: WebviewWindow, state: State<'_, AppState>) -> Res<Vec<AccountApps>> {
|
||||
guard(&window)?;
|
||||
let ids: Vec<String> = saved(&state)?.accounts.iter().map(|a| a.id.clone()).collect();
|
||||
ids.into_iter()
|
||||
.map(|account| {
|
||||
let entry = state.cache.get(&format!("acct:{account}"), "apps.list", &json!({})).map_err(Fail::host)?;
|
||||
Ok(AccountApps { account, entry })
|
||||
let accounts = saved(&state)?.accounts.clone();
|
||||
let store_only = registry::read_store_apps(&state.registry);
|
||||
accounts
|
||||
.iter()
|
||||
.map(|a| {
|
||||
let entry = state.cache.get(&format!("acct:{}", a.id), "apps.list", &json!({})).map_err(Fail::host)?;
|
||||
// apps live on a store with no project on this machine (`storebound apps add --store … --app-id …`)
|
||||
let at = entry.as_ref().map(|e| e.at.clone()).unwrap_or_else(store::now_iso);
|
||||
let entry = match store_only_into(&accounts, a, entry.as_ref().map(|e| e.value.clone()), &store_only, &at) {
|
||||
Some(value) => Some(Entry { value, at }),
|
||||
None => entry,
|
||||
};
|
||||
Ok(AccountApps { account: a.id.clone(), entry })
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue