-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(nextcloud): Convert helpers into Typescript
- Loading branch information
Showing
2 changed files
with
25 additions
and
18 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import type { IOCozyFile } from 'cozy-client/types/types' | ||
import flag from 'cozy-flags' | ||
|
||
export const computeNextcloudFolderQueryId = ({ | ||
sourceAccount, | ||
path | ||
}: { | ||
sourceAccount: string | ||
path: string | ||
}): string => { | ||
return `io.cozy.remote.nextcloud.files/sourceAccount/${sourceAccount}/path${path}` | ||
} | ||
|
||
/** | ||
* Checks if the given file is a Nextcloud shortcut. | ||
* | ||
* @param file - The file object to check. | ||
* @returns - Returns true if the file is a Nextcloud shortcut, false otherwise. | ||
*/ | ||
export const isNextcloudShortcut = (file: IOCozyFile): boolean => { | ||
return ( | ||
file.cozyMetadata?.createdByApp === 'nextcloud' && | ||
flag('drive.show-nextcloud-dev') | ||
) | ||
} |