From dece95cc1f465f4bf31365972ce6a895ecd9eb6e Mon Sep 17 00:00:00 2001 From: tadejpodrekar Date: Fri, 8 Dec 2023 11:38:29 +0100 Subject: [PATCH] chore: update google backup filename (#532) * Separate backup files for different wallets (seed-phrases) --- packages/dapp/src/app/api/google/route.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/dapp/src/app/api/google/route.tsx b/packages/dapp/src/app/api/google/route.tsx index 30a053f86..3d71e8dff 100644 --- a/packages/dapp/src/app/api/google/route.tsx +++ b/packages/dapp/src/app/api/google/route.tsx @@ -35,7 +35,7 @@ async function createDriveFile( const mimeType = 'text/plain'; const fileMetadata = { parents: ['appDataFolder'], - name: `${process.env.GOOGLE_DRIVE_FILE_NAME}${wallet}`, + name: `${process.env.GOOGLE_DRIVE_FILE_NAME}-${wallet}.txt`, mimeType, }; const media = { @@ -54,7 +54,7 @@ async function createDriveFile( async function getBackupFileId(drive: drive_v3.Drive, wallet: string) { let id; const list = await drive.files.list({ - q: `name='${process.env.GOOGLE_DRIVE_FILE_NAME}${wallet}'`, + q: `name='${process.env.GOOGLE_DRIVE_FILE_NAME}-${wallet}.txt'`, spaces: 'appDataFolder', }); @@ -90,7 +90,7 @@ async function updateDriveFile( return res; } const media = { - mimeType: 'text/plains', + mimeType: 'text/plain', body: content, }; const res = await drive.files.update({