iOS: the app's settings in Settings, not behind a shake; iPhone upright (#445)
The server address and the player token were set from alerts that opened on shaking the phone, which nobody finds. Settings now has a This device section in the app: the server, the player token and its address, and a Make button that creates an API token and hands it straight to the app's keychain. The app sends what it has at ready (appSettings) and takes setServer, setToken and clearToken; a new server rebuilds the web view as the alert did. The first-launch prompt and the Cannot reach alert stay native, since there is no page then. The iPhone is portrait only; the iPad keeps all four orientations, which Split View and Slide Over need (#434 checked the iPad's layout). Build 14. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -192,6 +192,15 @@ ok(fetched.some(f => f.startsWith('POST /api/push/devices') && f.includes('"sand
|
||||
await vm.runInContext('forgetPush()', ctx);
|
||||
ok(fetched.some(f => f.startsWith(`DELETE /api/push/devices/${'ab'.repeat(32)}`)), 'signing out left ipx counting for this phone');
|
||||
|
||||
// The app's own settings (#445), in Settings: only once the app has sent them.
|
||||
ok(vm.runInContext('deviceSettingsHTML()', ctx) === '', 'Settings offered app settings the app never sent');
|
||||
ctx.window.ipxNative.on({ t: 'appSettings', server: 'https://ipx.example"><b>', api: 'https://api.example', tokenSet: false });
|
||||
const device = String(vm.runInContext('deviceSettingsHTML()', ctx));
|
||||
ok(device.includes('https://api.example') && device.includes('Not set'), "Settings does not show the app's server and token");
|
||||
ok(!device.includes('"><b>'), 'the server address went into Settings unescaped');
|
||||
ctx.window.ipxNative.on({ t: 'appSettings', server: 'https://ipx.example', api: 'https://api.example', tokenSet: true });
|
||||
ok(String(vm.runInContext('deviceSettingsHTML()', ctx)).includes('placeholder="Set"'), 'a saved token still shows as not set');
|
||||
|
||||
// CarPlay (#420): the car picks another episode, and the page's bar lets go of the old one.
|
||||
vm.runInContext('player.guid="g1";player.feed="f";player.enc=42;player.entry=E', Object.assign(ctx, { E: entry }));
|
||||
body.classList.toggle('has-video', false);
|
||||
|
||||
Reference in New Issue
Block a user