0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 16:22:44 +00:00

Mark as owner if stub doesn't exist

Old Google Drive files without a stub have no author, so if no stub exists, consider the current user the owner.
This commit is contained in:
Trevor Buckner
2024-12-18 13:45:53 -05:00
parent 64b792c645
commit e61144beb8

View File

@@ -106,7 +106,7 @@ const api = {
stub = stub?.toObject();
googleId ??= stub?.googleId;
const isOwner = stub?.authors?.length === 0 || stub?.authors?.[0] === req.account?.username;
const isOwner = !stub || stub?.authors?.length === 0 || stub?.authors?.[0] === req.account?.username;
const isAuthor = stub?.authors?.includes(req.account?.username);
const isInvited = stub?.invitedAuthors?.includes(req.account?.username);