Skip to content

Commit

Permalink
chore: remove commented
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanaden committed Jun 27, 2024
1 parent c8f157b commit f35de96
Showing 1 changed file with 0 additions and 89 deletions.
89 changes: 0 additions & 89 deletions rm-main/src/ui/tabs/torrents/task_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,92 +147,3 @@ impl TaskManager {
}
}
}

// enum CurrentTaskState {
// Nothing,
// Loading(Arc<Mutex<ThrobberState>>),
// Success(),
// Failure(),
// }
//
// impl CurrentTaskState {
// fn new() -> Self {
// Self::Nothing
// }
//
// fn loading(&mut self, state: Arc<Mutex<ThrobberState>>) {
// *self = Self::Loading(task, state);
// }
//
// fn failure(&mut self) {
// *self = Self::Failure(task);
// }
//
// fn success(&mut self, task: CurrentTask) {
// *self = Self::Success(task);
// }
// }
//
// impl Component for CurrentTaskState {
// fn render(&mut self, f: &mut Frame, rect: Rect) {
// match self {
// CurrentTaskState::Nothing => return,
// CurrentTaskState::Loading(task, state) => {
// let label = match task {
// CurrentTask::DeleteBar(_) => Some("Deleting..."),
// CurrentTask::AddMagnetBar(_) => Some("Adding..."),
// _ => None,
// };
//
// if let Some(text) = label {
// let default_throbber = throbber_widgets_tui::Throbber::default()
// .label(text)
// .style(ratatui::style::Style::default().fg(ratatui::style::Color::Yellow));
// f.render_stateful_widget(
// default_throbber.clone(),
// rect,
// &mut state.lock().unwrap(),
// );
// }
// }
// CurrentTaskState::Failure(task) => {
// let label = match task {
// CurrentTask::DeleteBar(_) => Some(" Error deleting torrent"),
// CurrentTask::AddMagnetBar(_) => Some(" Error adding torrent"),
// _ => None,
// };
// if let Some(text) = label {
// let mut line = Line::default();
// line.push_span(Span::styled("", Style::default().red()));
// line.push_span(Span::raw(text));
// let paragraph = Paragraph::new(line);
// f.render_widget(paragraph, rect);
// }
// }
// CurrentTaskState::Success(task) => {
// let label = match task {
// CurrentTask::DeleteBar(_) => Some(" Deleted torrent"),
// CurrentTask::AddMagnetBar(_) => Some(" Added torrent"),
// _ => None,
// };
// if let Some(text) = label {
// let mut line = Line::default();
// line.push_span(Span::styled("", Style::default().green()));
// line.push_span(Span::raw(text));
// let paragraph = Paragraph::new(line);
// f.render_widget(paragraph, rect);
// }
// }
// }
// }
//
// fn tick(&mut self) -> Option<Action> {
// match self {
// CurrentTaskState::Loading(_, state) => {
// state.lock().unwrap().calc_next();
// Some(Action::Render)
// }
// _ => None,
// }
// }
// }

0 comments on commit f35de96

Please sign in to comment.