Skip to content

Commit

Permalink
Merge pull request #35 from your-papa/dev
Browse files Browse the repository at this point in the history
Release 0.2.7
  • Loading branch information
nicobrauchtgit authored Mar 1, 2024
2 parents acccb06 + 6c9865c commit 600ade4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Interact with your privacy focused assistant, leveraging Ollama or OpenAI, making your second brain even smarter.",
"author": "Leo310, nicobrauchtgit",
"authorUrl": "https://github.com/nicobrauchtgit",
"version": "0.2.6",
"version": "0.2.7",
"minAppVersion": "1.5.0",
"isDesktopOnly": true
}
1 change: 0 additions & 1 deletion src/components/Settings/Settings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@
await $plugin.saveSettings();
componentBaseUrl.setInputValue($plugin.data.ollamaGenModel.baseUrl);
changeOllamaBaseUrl($plugin.data.ollamaGenModel.baseUrl);
$papaState = 'settings-change';
};
const hideApiKey = () => {
Expand Down
11 changes: 9 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,14 @@ export default class SecondBrainPlugin extends Plugin {
plugin.set(this);
Log.setLogLevel(this.data.isVerbose ? LogLvl.DEBUG : LogLvl.DISABLED);

this.app.workspace.onLayoutReady(() => this.initPapa());
this.app.workspace.onLayoutReady(() => {
const leaves = this.app.workspace.getLeavesOfType(VIEW_TYPE_CHAT) || this.app.workspace.getLeavesOfType(VIEW_TYPE_SETUP);
if (leaves.length) {
this.leaf = leaves[0];
this.activateView();
}
this.initPapa();
});
// reembed documents on change
this.registerEvent(
this.app.metadataCache.on('changed', async (file: TFile) => {
Expand Down Expand Up @@ -213,7 +220,7 @@ export default class SecondBrainPlugin extends Plugin {
this.registerEvent(
this.app.workspace.on('layout-change', () => {
if (!this.leaf) {
const leaves = this.app.workspace.getLeavesOfType(get(isOnboarded) ? VIEW_TYPE_CHAT : VIEW_TYPE_SETUP);
const leaves = this.app.workspace.getLeavesOfType(VIEW_TYPE_CHAT) || this.app.workspace.getLeavesOfType(VIEW_TYPE_SETUP);
if (!leaves.length) return;
this.leaf = leaves[0];
}
Expand Down

0 comments on commit 600ade4

Please sign in to comment.