frontend: polish app launch and release experience
This commit is contained in:
@@ -450,6 +450,12 @@ describe('RPCClient convenience methods', () => {
|
||||
expect(getLastMethod()).toBe('package.uninstall')
|
||||
})
|
||||
|
||||
it('uninstallPackage forwards preserve_data when requested', async () => {
|
||||
mockSuccess(undefined)
|
||||
await rpcClient.uninstallPackage('btc', { preserveData: true })
|
||||
expect(getLastParams()).toEqual({ id: 'btc', preserve_data: true })
|
||||
})
|
||||
|
||||
it('startPackage calls package.start', async () => {
|
||||
mockSuccess(undefined)
|
||||
await rpcClient.startPackage('btc')
|
||||
|
||||
@@ -201,7 +201,7 @@ class RPCClient {
|
||||
currentPassword: string
|
||||
newPassword: string
|
||||
alsoChangeSsh?: boolean
|
||||
}): Promise<{ success: boolean }> {
|
||||
}): Promise<{ success: boolean; ssh_updated?: boolean; ssh_error?: string | null }> {
|
||||
return this.call({
|
||||
method: 'auth.changePassword',
|
||||
params: {
|
||||
@@ -536,14 +536,17 @@ class RPCClient {
|
||||
})
|
||||
}
|
||||
|
||||
async uninstallPackage(id: string): Promise<{ status: string; package_id: string }> {
|
||||
async uninstallPackage(
|
||||
id: string,
|
||||
options: { preserveData?: boolean } = {},
|
||||
): Promise<{ status: string; package_id: string }> {
|
||||
// Backend is async — returns { status: 'removing' } immediately after
|
||||
// flipping state. Graceful stop (up to 600s for bitcoin) and data wipe
|
||||
// (up to minutes for large chainstate) run in a background task.
|
||||
// Progress shown via uninstall_stage field on the package entry.
|
||||
return this.call({
|
||||
method: 'package.uninstall',
|
||||
params: { id },
|
||||
params: { id, ...(options.preserveData !== undefined ? { preserve_data: options.preserveData } : {}) },
|
||||
timeout: 15000,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user