From c5f4793c23805fe2ba32dc98daa15c422ba280ee Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 26 Jun 2023 17:43:19 +1200 Subject: [PATCH] Add owner info to missing Google file message --- client/homebrew/pages/errorPage/errors/errorIndex.js | 3 ++- server/homebrew.api.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/errorPage/errors/errorIndex.js b/client/homebrew/pages/errorPage/errors/errorIndex.js index 7a9dd4d2b..1fdce66b9 100644 --- a/client/homebrew/pages/errorPage/errors/errorIndex.js +++ b/client/homebrew/pages/errorPage/errors/errorIndex.js @@ -25,7 +25,8 @@ const errorIndex = (props)=>{ you tried to open doesn't work anymore. The Homebrewery cannot delete files from your Google Drive on its own, so there are three most likely possibilities: : - - **You may have accidentally deleted the Google Drive files.** Look on your Google Drive + - **You may have accidentally deleted the Google Drive files.** Look on + ${props.brew.authors?.length > 0 ? `the Google Drive account associated with the **${props.brew.authors[0]}** Homebrewery account` : 'your Google Drive account'} and make sure the Homebrewery folder is still there, and that it holds your brews as text files. - **You may have changed the sharing settings for your files.** If the files diff --git a/server/homebrew.api.js b/server/homebrew.api.js index d8e3318fa..4c6961b5a 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -59,7 +59,7 @@ const api = { // Throw any error caught while attempting to retrieve Google brew. if(googleError) { const reason = googleError.errors[0].reason; - throw { ...googleError, HBErrorCode: reason == 'notFound' ? '02' : '01' }; + throw { ...googleError, HBErrorCode: reason == 'notFound' ? '02' : '01', authors: stub?.authors }; } // Combine the Homebrewery stub with the google brew, or if the stub doesn't exist just use the google brew stub = stub ? _.assign({ ...api.excludeStubProps(stub), stubbed: true }, api.excludeGoogleProps(googleBrew)) : googleBrew;