mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-12-25 18:49:11 +03:00
only local branches, scroll into view
This commit is contained in:
parent
fb2a39b280
commit
6e0358baae
@ -1,6 +1,6 @@
|
||||
use crate::{deltas, fs, projects, sessions, users};
|
||||
use anyhow::{Context, Result};
|
||||
use git2::{Cred, Signature};
|
||||
use git2::{BranchType, Cred, Signature};
|
||||
use std::{collections::HashMap, env, path::Path};
|
||||
use tauri::regex::Regex;
|
||||
use walkdir::WalkDir;
|
||||
@ -158,7 +158,7 @@ impl Repository {
|
||||
|
||||
pub fn branches(&self) -> Result<Vec<String>> {
|
||||
let mut branches = vec![];
|
||||
for branch in self.git_repository.branches(None)? {
|
||||
for branch in self.git_repository.branches(Some(BranchType::Local))? {
|
||||
let (branch, _) = branch?;
|
||||
branches.push(branch.name()?.unwrap().to_string());
|
||||
}
|
||||
|
@ -119,6 +119,11 @@
|
||||
} else {
|
||||
items[items.length - 1].classList.add(...activeClass);
|
||||
}
|
||||
// scroll into view
|
||||
const active2 = menu.querySelector('li.active');
|
||||
if (active2) {
|
||||
active2.scrollIntoView({ block: 'nearest' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -136,6 +141,11 @@
|
||||
} else {
|
||||
items[0].classList.add(...activeClass);
|
||||
}
|
||||
// scroll into view
|
||||
const active2 = menu.querySelector('li.active');
|
||||
if (active2) {
|
||||
active2.scrollIntoView({ block: 'nearest' });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user