@@ -2,7 +2,7 @@ import {App, Notice, Plugin, PluginSettingTab, setIcon, Setting} from 'obsidian'
2
2
import { api_authenticate , RepoItem } from "./API/ApiHandler" ;
3
3
import { IssuesModal } from "./Elements/Modals/IssuesModal" ;
4
4
import { Octokit } from "@octokit/core" ;
5
- import { softUpdateIssues , updateIssues } from "./Issues/IssueUpdater" ;
5
+ import { getRepoInFile , softUpdateIssues , updateIssues } from "./Issues/IssueUpdater" ;
6
6
import { NewIssueModal } from "./Elements/Modals/NewIssueModal" ;
7
7
import { createCompactIssueElement , createDefaultIssueElement } from "./Elements/IssueItems" ;
8
8
import { CSVIssue , Issue } from "./Issues/Issue" ;
@@ -175,10 +175,16 @@ export default class MyPlugin extends Plugin {
175
175
name : 'Embed open Issues' ,
176
176
callback : ( ) => {
177
177
if ( this . octokit ) {
178
- new IssuesModal ( this . app , {
179
- octokit : this . octokit ,
180
- plugin_settings : this . settings
181
- } as OctoBundle ) . open ( ) ;
178
+ //check if repo already exists in file
179
+ const repo = getRepoInFile ( this . app )
180
+ if ( repo ) {
181
+ new Notice ( "Only one repo per file is supported at the moment! Current repo:" + repo . name + "/" + repo . repo )
182
+ } else {
183
+ new IssuesModal ( this . app , {
184
+ octokit : this . octokit ,
185
+ plugin_settings : this . settings
186
+ } as OctoBundle ) . open ( ) ;
187
+ }
182
188
} else {
183
189
new Notice ( errors . noCreds ) ;
184
190
}
@@ -288,10 +294,10 @@ class GithubIssuesSettings extends PluginSettingTab {
288
294
containerEl . createEl ( 'h2' , { text : 'Github Authentication' } ) ;
289
295
290
296
containerEl . createSpan ( {
291
- text : "For authenticating you need to provide your Github Username and a Personal Authentication Token . You can create a new token "
297
+ text : "To use this plugin, you need to create a personal access token . You can find a guide on how to do that in the "
292
298
} ) . createEl ( 'a' , {
293
- text : "here ." ,
294
- href : "https://docs. github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token "
299
+ text : "README ." ,
300
+ href : "https://github.com/Frostplexx/obsidian-github-issues#prerequisites "
295
301
} )
296
302
297
303
// username
0 commit comments