mirror of
https://github.com/tiddly-gittly/TidGi-Desktop.git
synced 2025-12-06 02:30:47 -08:00
fix: check git before get git
This commit is contained in:
parent
c9a34b8a8f
commit
2bb6831bae
3 changed files with 6 additions and 5 deletions
|
|
@ -106,7 +106,6 @@ export function useWikiWorkspaceForm() {
|
|||
}, [mainWikiToLink]);
|
||||
const [gitRepoUrl, gitRepoUrlSetter] = useState<string>('');
|
||||
|
||||
// FIXME: on dev, this will get TiddlyGit 's remote repo
|
||||
useEffect(() => {
|
||||
void (async function getWorkspaceRemoteEffect(): Promise<void> {
|
||||
if (existedWikiFolderPath !== undefined) {
|
||||
|
|
|
|||
|
|
@ -47,8 +47,10 @@ export class Git implements IGitService {
|
|||
|
||||
public debounceCommitAndSync: (wikiFolderPath: string, remoteUrl: string, userInfo: IGitUserInfos) => Promise<void> | undefined;
|
||||
|
||||
public async getWorkspacesRemote(wikiFolderPath: string): Promise<string> {
|
||||
return await getRemoteUrl(wikiFolderPath);
|
||||
public async getWorkspacesRemote(wikiFolderPath: string): Promise<string | undefined> {
|
||||
if (await hasGit(wikiFolderPath)) {
|
||||
return await getRemoteUrl(wikiFolderPath);
|
||||
}
|
||||
}
|
||||
|
||||
public async getModifiedFileList(wikiFolderPath: string): Promise<ModifiedFileList[]> {
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ export interface IGitService {
|
|||
initWikiGit(wikiFolderPath: string, isSyncedWiki: true, remoteUrl: string, userInfo: IGitUserInfos): Promise<void>;
|
||||
initWikiGit(wikiFolderPath: string, isSyncedWiki?: false): Promise<void>;
|
||||
commitAndSync(wikiFolderPath: string, remoteUrl: string, userInfo: IGitUserInfos): Promise<void>;
|
||||
/** Inspect git's remote url from folder's .git config */
|
||||
getWorkspacesRemote(wikiFolderPath: string): Promise<string>;
|
||||
/** Inspect git's remote url from folder's .git config, return undefined if there is no initialized git */
|
||||
getWorkspacesRemote(wikiFolderPath: string): Promise<string | undefined>;
|
||||
clone(remoteUrl: string, repoFolderPath: string, userInfo: IGitUserInfos): Promise<void>;
|
||||
}
|
||||
export const GitServiceIPCDescriptor = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue