File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ interface CheckOptions {
2222 * Target identifier for the running application. This is sent to the backend.
2323 */
2424 target ?: string
25+ /**
26+ * Allow downgrades to previous versions by not checking if the current version is greater than the available version.
27+ */
28+ allowDowngrades ?: boolean
2529}
2630
2731/** Options used when downloading an update */
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ pub(crate) async fn check<R: Runtime>(
4646 timeout : Option < u64 > ,
4747 proxy : Option < String > ,
4848 target : Option < String > ,
49+ allow_downgrades : Option < bool > ,
4950) -> Result < Option < Metadata > > {
5051 let mut builder = webview. updater_builder ( ) ;
5152 if let Some ( headers) = headers {
@@ -63,6 +64,9 @@ pub(crate) async fn check<R: Runtime>(
6364 if let Some ( target) = target {
6465 builder = builder. target ( target) ;
6566 }
67+ if allow_downgrades. unwrap_or ( false ) {
68+ builder = builder. version_comparator ( |current, update| update. version != current) ;
69+ }
6670
6771 let updater = builder. build ( ) ?;
6872 let update = updater. check ( ) . await ?;
You can’t perform that action at this time.
0 commit comments