mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-28 04:47:42 +03:00
move to Git event on git data, not session event
This commit is contained in:
parent
6299a97e73
commit
ffe56ab14c
@ -15,6 +15,17 @@ impl Event {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn git(project: &projects::Project) -> Self {
|
||||
let event_name = format!("project://{}/git", project.id);
|
||||
let payload = serde_json::json!({
|
||||
"logs/HEAD": "updated",
|
||||
});
|
||||
Event {
|
||||
name: event_name,
|
||||
payload: payload,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn detlas(
|
||||
project: &projects::Project,
|
||||
session: &sessions::Session,
|
||||
|
@ -108,13 +108,8 @@ fn on_file_change(
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
let repo = git2::Repository::open(project.path.clone())?;
|
||||
let event = match sessions::Session::current(&repo, &project)? {
|
||||
Some(current_session) => Some(events::Event::session(&project, ¤t_session)),
|
||||
None => None,
|
||||
};
|
||||
|
||||
Ok(event)
|
||||
let event = events::Event::git(&project);
|
||||
Ok(Some(event))
|
||||
}
|
||||
|
||||
fn is_interesting_event(kind: ¬ify::EventKind) -> Option<String> {
|
||||
|
@ -29,8 +29,8 @@ export default async (params: { projectId: string }) => {
|
||||
|
||||
const store = writable(statuses);
|
||||
|
||||
appWindow.listen<Session>(`project://${params.projectId}/sessions`, async (event) => {
|
||||
log.info(`Status: Received sessions event, projectId: ${params.projectId}`);
|
||||
appWindow.listen(`project://${params.projectId}/git`, async (event) => {
|
||||
log.info(`Status: Received git event, projectId: ${params.projectId}`);
|
||||
const statusesGit = await listFiles(params);
|
||||
const statuses = convertToStatuses(statusesGit);
|
||||
store.set(statuses);
|
||||
|
Loading…
Reference in New Issue
Block a user