Add support for no device limit on links (#1337)
This commit is contained in:
commit
bbe28c8a17
|
@ -393,6 +393,7 @@
|
|||
"LINK_PASSWORD_LOCK": "Password lock",
|
||||
"PUBLIC_COLLECT": "Allow adding photos",
|
||||
"LINK_DEVICE_LIMIT": "Device limit",
|
||||
"NO_DEVICE_LIMIT": "None",
|
||||
"LINK_EXPIRY": "Link expiry",
|
||||
"NEVER": "Never",
|
||||
"DISABLE_FILE_DOWNLOAD": "Disable download",
|
||||
|
|
|
@ -56,7 +56,11 @@ export function ManageDeviceLimit({
|
|||
<EnteMenuItem
|
||||
label={t('LINK_DEVICE_LIMIT')}
|
||||
variant="captioned"
|
||||
subText={publicShareProp.deviceLimit.toString()}
|
||||
subText={
|
||||
publicShareProp.deviceLimit === 0
|
||||
? t('NO_DEVICE_LIMIT')
|
||||
: publicShareProp.deviceLimit.toString()
|
||||
}
|
||||
onClick={openDeviceLimitChangeModalView}
|
||||
endIcon={<ChevronRight />}
|
||||
/>
|
||||
|
|
|
@ -134,11 +134,12 @@ export function appendCollectionKeyToShareURL(
|
|||
}
|
||||
|
||||
const _intSelectOption = (i: number) => {
|
||||
return { label: i.toString(), value: i };
|
||||
const label = i === 0 ? t('NO_DEVICE_LIMIT') : i.toString();
|
||||
return { label, value: i };
|
||||
};
|
||||
|
||||
export function getDeviceLimitOptions() {
|
||||
return [2, 5, 10, 25, 50].map((i) => _intSelectOption(i));
|
||||
return [0, 2, 5, 10, 25, 50].map((i) => _intSelectOption(i));
|
||||
}
|
||||
|
||||
export const shareExpiryOptions = () => [
|
||||
|
|
Loading…
Reference in a new issue