From c218b71c8ea27af2750c1a08f28ff6dea803ef8e Mon Sep 17 00:00:00 2001 From: Salah Aldeen Al Saleh Date: Wed, 27 Sep 2023 20:57:17 +0000 Subject: [PATCH] Fix empty automatic partial snapshots dropdown --- web/src/components/snapshots/AppSnapshotRestore.jsx | 7 +++++-- web/src/components/snapshots/SnapshotSettings.jsx | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/web/src/components/snapshots/AppSnapshotRestore.jsx b/web/src/components/snapshots/AppSnapshotRestore.jsx index 57734f44f1..7dc9db2fc3 100644 --- a/web/src/components/snapshots/AppSnapshotRestore.jsx +++ b/web/src/components/snapshots/AppSnapshotRestore.jsx @@ -44,6 +44,7 @@ class AppSnapshotRestore extends Component { fetchRestoreDetail = async () => { const { params } = this.props; const restoreName = params.id; + const appSlug = params.slug; this.setState({ errorMessage: "", @@ -52,7 +53,7 @@ class AppSnapshotRestore extends Component { try { const res = await fetch( - `${process.env.API_ENDPOINT}/app/${this.props.app?.slug}/snapshot/restore/${restoreName}`, + `${process.env.API_ENDPOINT}/app/${appSlug}/snapshot/restore/${restoreName}`, { method: "GET", credentials: "include", @@ -100,7 +101,9 @@ class AppSnapshotRestore extends Component { }); try { await this.fetchCancelRestore(); - this.props.navigate(`/snapshots/partial/${this.props.app?.slug}`); + const { params } = this.props; + const appSlug = params.slug; + this.props.navigate(`/snapshots/partial/${appSlug}`); } catch (err) { this.setState({ cancelRestoreErr: true, diff --git a/web/src/components/snapshots/SnapshotSettings.jsx b/web/src/components/snapshots/SnapshotSettings.jsx index b49524f2ca..0c08b05dd8 100644 --- a/web/src/components/snapshots/SnapshotSettings.jsx +++ b/web/src/components/snapshots/SnapshotSettings.jsx @@ -363,7 +363,7 @@ class SnapshotSettings extends Component { this.hideResetFileSystemWarningModal } isKurlEnabled={this.props.isKurlEnabled} - apps={this.props.apps} + apps={this.props.appsList} />