File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ interface CheckOptions {
22
22
* Target identifier for the running application. This is sent to the backend.
23
23
*/
24
24
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
25
29
}
26
30
27
31
/** 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>(
46
46
timeout : Option < u64 > ,
47
47
proxy : Option < String > ,
48
48
target : Option < String > ,
49
+ allow_downgrades : Option < bool > ,
49
50
) -> Result < Option < Metadata > > {
50
51
let mut builder = webview. updater_builder ( ) ;
51
52
if let Some ( headers) = headers {
@@ -63,6 +64,9 @@ pub(crate) async fn check<R: Runtime>(
63
64
if let Some ( target) = target {
64
65
builder = builder. target ( target) ;
65
66
}
67
+ if allow_downgrades. unwrap_or ( false ) {
68
+ builder = builder. version_comparator ( |current, update| update. version != current) ;
69
+ }
66
70
67
71
let updater = builder. build ( ) ?;
68
72
let update = updater. check ( ) . await ?;
You can’t perform that action at this time.
0 commit comments