Skip to content

Commit 6f377c6

Browse files
Merge pull request #58 from francesco-gaglione/57-bug-installing-message-appears-after-canceling-image-selection-in-picker-dialog
fix cancell behaviour
2 parents 59049f1 + bbfd8dc commit 6f377c6

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/app.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,10 +258,11 @@ impl Application for AppModel {
258258
.update(InstallFromFileMessage::FileSelected(message))
259259
.map(cosmic::app::Message::App),
260260
),
261-
Message::Cancelled => {
262-
log::info!("Not implemented yet");
263-
//TODO show info message (a toast?)
264-
}
261+
Message::Cancelled => commands.push(
262+
self.install_from_file
263+
.update(InstallFromFileMessage::Cancelled)
264+
.map(cosmic::app::Message::App),
265+
),
265266
Message::OpenError(arc_err) => {
266267
log::error!("Error happened: {}", arc_err);
267268
}

src/pages/install_from_file.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,10 @@ impl InstallFromFile {
221221
InstallFromFileMessage::Cancelled => {
222222
self.loading = false;
223223
}
224-
InstallFromFileMessage::OpenError(arc) => todo!(),
224+
InstallFromFileMessage::OpenError(arc) => {
225+
//TODO sho error message
226+
self.loading = false;
227+
},
225228
InstallFromFileMessage::InstallationSuccessful => {
226229
self.loading = false;
227230
}

0 commit comments

Comments
 (0)