make path once
Some checks are pending
/ test (push) Waiting to run

This commit is contained in:
Chris Cochrun 2026-01-29 11:50:30 -06:00
parent 7d03ea4b34
commit 7dae3b03c0

View file

@ -101,19 +101,18 @@ impl PresentationEditor {
self.update_entire_presentation(&presentation);
if let Some(presentation) = &self.presentation {
let task;
let path = presentation.path.clone();
if let PresKind::Pdf {
starting_index,
ending_index,
} = presentation.kind.clone()
{
let range = starting_index..=ending_index;
let path = presentation.path.clone();
task = Task::perform(
async move { get_pages(range, path) },
Message::AddSlides,
);
} else {
let path = presentation.path.clone();
task = Task::perform(
async move { get_pages(.., path) },
Message::AddSlides,
@ -167,19 +166,18 @@ impl PresentationEditor {
self.update_entire_presentation(&presentation);
if let Some(presentation) = &self.presentation {
let mut task;
let path = presentation.path.clone();
if let PresKind::Pdf {
starting_index,
ending_index,
} = presentation.kind.clone()
{
let range = starting_index..=ending_index;
let path = presentation.path.clone();
task = Task::perform(
async move { get_pages(range, path) },
Message::AddSlides,
);
} else {
let path = presentation.path.clone();
task = Task::perform(
async move { get_pages(.., path) },
Message::AddSlides,