mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-02 21:19:12 +00:00
Add manual sync command to Khoj plugin
- Introduced a new command 'Sync new changes' to allow users to manually synchronize new modifications. - The command updates the content index without regenerating it, ensuring only new changes are synced. - User-triggered notifications are displayed upon successful sync.
This commit is contained in:
@@ -34,6 +34,21 @@ export default class Khoj extends Plugin {
|
||||
callback: () => { this.activateView(KhojView.CHAT); }
|
||||
});
|
||||
|
||||
// Add sync command to manually sync new changes
|
||||
this.addCommand({
|
||||
id: 'sync',
|
||||
name: 'Sync new changes',
|
||||
callback: async () => {
|
||||
this.settings.lastSync = await updateContentIndex(
|
||||
this.app.vault,
|
||||
this.settings,
|
||||
this.settings.lastSync,
|
||||
false, // regenerate = false pour ne synchroniser que les nouvelles modifications
|
||||
true // userTriggered = true pour afficher une notification
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
this.registerView(KhojView.CHAT, (leaf) => new KhojChatView(leaf, this.settings));
|
||||
|
||||
// Create an icon in the left ribbon.
|
||||
|
||||
Reference in New Issue
Block a user