mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 01:22:10 +08:00
FIX: Show the correct message when no user export exists. (#30970)
Followup to 7fc8d74f3eed52116add452b5321b41e02e04499 We need to check that the user export data exists before creating a model, since having an empty model will cause the UI to incorrectly think there's a user export to display. This change shows the correct message, instead.
This commit is contained in:
parent
aa90ba2992
commit
37d1212865
@ -28,7 +28,9 @@ export default class extends Component {
|
||||
this.messageBus.subscribe(EXPORT_PROGRESS_CHANNEL, this.onExportProgress);
|
||||
|
||||
this.model = this.args.model;
|
||||
this.userExport = UserExport.create(this.model.latest_export?.user_export);
|
||||
if (this.model.latest_export) {
|
||||
this.userExport = UserExport.create(this.model.latest_export.user_export);
|
||||
}
|
||||
}
|
||||
|
||||
willDestroy() {
|
||||
@ -43,7 +45,9 @@ export default class extends Component {
|
||||
if (data.failed) {
|
||||
this.dialog.alert(i18n("admin.user.exports.download.export_failed"));
|
||||
} else {
|
||||
if (data.export_data.user_export) {
|
||||
this.userExport = UserExport.create(data.export_data.user_export);
|
||||
}
|
||||
this.toasts.success({
|
||||
autoClose: false,
|
||||
data: { message: i18n("admin.user.exports.download.success") },
|
||||
|
Loading…
x
Reference in New Issue
Block a user