Skip to content

Commit

Permalink
馃搨Fix public link backend (#2786)
Browse files Browse the repository at this point in the history
* Fix public link backend

* Fix return without resolve
  • Loading branch information
RomaricMourgues authored and Labels Bot committed Mar 27, 2023
1 parent e2eb2f7 commit ed3df1f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -22,7 +22,7 @@ Twake offers all the features for collaboration :
- Video call and conferencing
- Real time document collaboration

<a href="https://twakeapp.com"><img width=800 src="https://github.com/linagora/Twake/raw/main/twake.png"/></a>
<a href="https://twake.app"><img width=800 src="https://github.com/linagora/Twake/raw/main/twake.png"/></a>

## Demo

Expand Down
Expand Up @@ -228,6 +228,7 @@ class DriveMigrator {
) {
logger.info(`item is already migrated - ${item.id} - skipping`);
console.log(`item is already migrated - ${item.id} - skipping`);
resolve(true);
return;
}

Expand Down Expand Up @@ -311,6 +312,7 @@ class DriveMigrator {

if (createdVersions === 0) {
await this.nodeRepository.remove(newDriveItem);
resolve(true);
return;
}
}
Expand Down
4 changes: 2 additions & 2 deletions twake/backend/node/src/services/documents/utils.ts
Expand Up @@ -319,7 +319,7 @@ export const checkAccess = async (
repository: Repository<DriveFile>,
context: CompanyExecutionContext & { public_token?: string; twake_tab_token?: string },
): Promise<boolean> => {
if (context.user.server_request) {
if (context.user?.server_request) {
return true;
}

Expand Down Expand Up @@ -674,7 +674,7 @@ export const getFileMetadata = async (
company_id: context.company.id,
},
context,
{ ...(context.user.server_request ? {} : { waitForThumbnail: true }) },
{ ...(context.user?.server_request ? {} : { waitForThumbnail: true }) },
);

if (!file) {
Expand Down
Expand Up @@ -86,7 +86,7 @@ export default memo(

//In case we are kicked out of the current folder, we need to reset the parent id
useEffect(() => {
if (!loading && !path?.length) setParentId('root');
if (!loading && !path?.length && !inPublicSharing) setParentId('root');
}, [path, loading, setParentId]);

useEffect(() => {
Expand Down

0 comments on commit ed3df1f

Please sign in to comment.