Skip to content

Commit

Permalink
fix(photos): remove usage loading
Browse files Browse the repository at this point in the history
  • Loading branch information
sg-gs committed Jun 18, 2024
1 parent 0b74286 commit 2c74800
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/app/drive/services/usage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,13 @@ export interface UsageDetailsProps {

export async function fetchUsage(): Promise<UsageResponse> {
const storageClient = SdkFactory.getInstance().createStorageClient();
const photosClient = await SdkFactory.getInstance().createPhotosClient();

let photosUsage = 0;
const driveUsage = await storageClient.spaceUsage();

try {
const { usage } = await photosClient.photos.getUsage();
photosUsage = usage;
} catch (error) {
errorService.reportError(error);
}

driveUsage.total += photosUsage;

return driveUsage;
}

async function getUsageDetails(): Promise<UsageDetailsProps> {
const storageClient = SdkFactory.getInstance().createStorageClient();
const photosClient = await SdkFactory.getInstance().createPhotosClient();

let drive = 0;
let backups = 0;
Expand All @@ -43,13 +30,6 @@ async function getUsageDetails(): Promise<UsageDetailsProps> {
errorService.reportError(error);
}

try {
const { usage } = await photosClient.photos.getUsage();
photos = usage;
} catch (error) {
errorService.reportError(error);
}

return {
drive,
photos,
Expand Down

0 comments on commit 2c74800

Please sign in to comment.