refactor: use getTiddlerText on WikiOperations instead of service.getTiddlerText

This commit is contained in:
linonetwo 2024-01-15 22:01:21 +08:00
parent 4b09485cea
commit 360157290b
6 changed files with 13 additions and 32 deletions

View file

@ -92,10 +92,10 @@ export class Git implements IGitService {
* similar to "linonetwo/wiki", string after "https://com/"
*/
const githubRepoName = `${userName}/${repoName}`;
if (await this.wikiService.getTiddlerText(workspace, '$:/GitHub/Repo') !== githubRepoName) {
if (await this.wikiService.wikiOperationInServer(WikiChannel.getTiddlerText, workspace.id, ['$:/GitHub/Repo']) !== githubRepoName) {
await this.wikiService.wikiOperationInBrowser(WikiChannel.addTiddler, workspace.id, ['$:/GitHub/Repo', githubRepoName]);
}
if (await this.wikiService.getTiddlerText(workspace, '$:/GitHub/Branch') !== branch) {
if (await this.wikiService.wikiOperationInServer(WikiChannel.getTiddlerText, workspace.id, ['$:/GitHub/Branch']) !== branch) {
await this.wikiService.wikiOperationInBrowser(WikiChannel.addTiddler, workspace.id, ['$:/GitHub/Branch', branch]);
}
}