diff --git a/ui/src/lib/utils/CacheUtils.ts b/ui/src/lib/utils/CacheUtils.ts index 8d0e178..c5eb9c8 100644 --- a/ui/src/lib/utils/CacheUtils.ts +++ b/ui/src/lib/utils/CacheUtils.ts @@ -7,12 +7,20 @@ export enum CacheKey{ export class CacheUtils{ static async setRepoDetails(data:IRepositoryDetails){ - await localforage.setItem(CacheKey.repoDetails+data.repoInfo.path,data); + try { + await localforage.setItem(CacheKey.repoDetails+data.repoInfo.path,data); + } catch (error) { + } } static async getRepoDetails(path:string){ - const res = await localforage.getItem(CacheKey.repoDetails+path); - return res; + try{ + const res = await localforage.getItem(CacheKey.repoDetails+path); + return res; + }catch(e){ + return null!; + } + } static async clearRepoDetails(path:string){ diff --git a/ui/src/lib/utils/RepoUtils.ts b/ui/src/lib/utils/RepoUtils.ts index f90da76..5e0270f 100644 --- a/ui/src/lib/utils/RepoUtils.ts +++ b/ui/src/lib/utils/RepoUtils.ts @@ -512,7 +512,7 @@ export class RepoUtils{ } static get activeRemoteInfo(){ - if(!RepoUtils.repositoryDetails.remotes.length) + if(!RepoUtils.repositoryDetails?.remotes.length) return undefined; const orignName = RepoUtils.repositoryDetails.repoInfo.activeOrigin; const remote = RepoUtils.repositoryDetails.remotes.find(_=> _.name === orignName);