<commit_before>class DeleteTimerScreen < PM::FormotionScreen
  title "Delete Timer"

  attr_accessor :timer

  def on_submit(_form)
    formValues = _form.render

    if formValues[:name] == timer.name
      timer.destroy
      cdq.save
      open_root_screen TimersScreen.new(nav_bar: true)
    else
      close_nav_screen
    end
  end

  def table_data
    {
      :sections => [{
        :title => "Re-enter timer name to delete",
        :rows  => [{
          :key                 => :name,
          :placeholder         => timer.name,
          :type                => :string
        }, {
          :title => "Confirm Delete",
          :type  => :submit
        }]
      }]
    }
  end
end<commit_msg>Alert if name isn't entered correctly<commit_after>class DeleteTimerScreen < PM::FormotionScreen
  title "Delete Timer"

  attr_accessor :timer

  def on_submit(_form)
    formValues = _form.render

    if formValues[:name] == timer.name
      timer.destroy
      cdq.save
      open_root_screen TimersScreen.new(nav_bar: true)
    else
      App.alert "Name does not match, try again", {
        :cancel_button_title => "Ok"
      }
    end
  end

  def table_data
    {
      :sections => [{
        :title => "Re-enter timer name to delete",
        :rows  => [{
          :key                 => :name,
          :placeholder         => timer.name,
          :type                => :string
        }, {
          :title => "Confirm Delete",
          :type  => :submit
        }]
      }]
    }
  end
end
{'fraction_non_alphanumeric': 0.10723684210526316, 'fraction_numerical': 0.0, 'mean_word_length': 1.6498257839721255, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1537434', 'n_tokens_mistral': 461, 'n_tokens_neox': 443, 'n_words': 106}