4747 </NcActions >
4848
4949 <!-- pending actions -->
50- <NcActions v-if =" !pending && (pendingPassword || pendingExpirationDate)"
50+ <NcActions v-if =" !pending && (pendingPassword || pendingEnforcedPassword || pendingExpirationDate)"
5151 class =" sharing-entry__actions"
5252 :aria-label =" actionsTooltip"
5353 menu-align =" right"
6464 </NcActionText >
6565
6666 <!-- password -->
67- <NcActionText v-if =" pendingPassword " icon =" icon-password" >
67+ <NcActionText v-if =" pendingEnforcedPassword " icon =" icon-password" >
6868 {{ t('files_sharing', 'Password protection (enforced)') }}
6969 </NcActionText >
70- <NcActionCheckbox v-else-if =" config.enableLinkPasswordByDefault "
70+ <NcActionCheckbox v-else-if =" pendingPassword "
7171 :checked.sync =" isPasswordProtected"
7272 :disabled =" config.enforcePasswordForPublicLink || saving"
7373 class =" share-link-password-checkbox"
7474 @uncheck =" onPasswordDisable" >
7575 {{ t('files_sharing', 'Password protection') }}
7676 </NcActionCheckbox >
7777
78- <NcActionInput v-if =" pendingPassword || share.password"
78+ <NcActionInput v-if =" pendingEnforcedPassword || share.password"
7979 class =" share-link-password"
8080 :value.sync =" share.password"
8181 :disabled =" saving"
@@ -517,6 +517,9 @@ export default {
517517 * @return {boolean}
518518 */
519519 pendingPassword () {
520+ return this .config .enableLinkPasswordByDefault && this .share && ! this .share .id
521+ },
522+ pendingEnforcedPassword () {
520523 return this .config .enforcePasswordForPublicLink && this .share && ! this .share .id
521524 },
522525 pendingExpirationDate () {
@@ -613,12 +616,9 @@ export default {
613616 // expiration is the share object key, not expireDate
614617 shareDefaults .expiration = this .formatDateToString (this .config .defaultExpirationDate )
615618 }
616- if (this .config .enableLinkPasswordByDefault ) {
617- shareDefaults .password = await GeneratePassword ()
618- }
619619
620620 // do not push yet if we need a password or an expiration date: show pending menu
621- if (this .config .enforcePasswordForPublicLink || this .config .isDefaultExpireDateEnforced ) {
621+ if (this .config .enableLinkPasswordByDefault || this . config . enforcePasswordForPublicLink || this .config .isDefaultExpireDateEnforced ) {
622622 this .pending = true
623623
624624 // if a share already exists, pushing it
@@ -641,8 +641,8 @@ export default {
641641 }
642642
643643 // ELSE, show the pending popovermenu
644- // if password enforced, pre-fill with random one
645- if (this .config .enforcePasswordForPublicLink ) {
644+ // if password default or enforced, pre-fill with random one
645+ if (this .config .enableLinkPasswordByDefault || this . config . enforcePasswordForPublicLink ) {
646646 shareDefaults .password = await GeneratePassword ()
647647 }
648648
0 commit comments