bind/js: Fix presentation mode disabling logic

This commit is contained in:
Diego Reis
2025-07-16 15:07:12 -03:00
parent b03b06107b
commit 21882d1db3
2 changed files with 62 additions and 30 deletions

View File

@@ -450,11 +450,10 @@ impl Statement {
#[napi]
pub fn pluck(&mut self, pluck: Option<bool>) {
if let Some(false) = pluck {
self.presentation_mode = PresentationMode::None;
}
self.presentation_mode = PresentationMode::Pluck;
self.presentation_mode = match pluck {
Some(false) => PresentationMode::None,
_ => PresentationMode::Pluck,
};
}
#[napi]
@@ -464,11 +463,10 @@ impl Statement {
#[napi]
pub fn raw(&mut self, raw: Option<bool>) {
if let Some(false) = raw {
self.presentation_mode = PresentationMode::None;
}
self.presentation_mode = PresentationMode::Raw;
self.presentation_mode = match raw {
Some(false) => PresentationMode::None,
_ => PresentationMode::Raw,
};
}
#[napi]