File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,11 +43,11 @@ export default class Share {
4343 ocsData . hide_download = ! ! ocsData . hide_download
4444 ocsData . mail_send = ! ! ocsData . mail_send
4545
46- if ( ocsData . attributes ) {
46+ if ( ocsData . attributes && typeof ocsData . attributes === 'string' ) {
4747 try {
4848 ocsData . attributes = JSON . parse ( ocsData . attributes )
4949 } catch ( e ) {
50- console . warn ( 'Could not parse share attributes returned by server: "' + ocsData . attributes + '"' )
50+ console . warn ( 'Could not parse share attributes returned by server' , ocsData . attributes )
5151 }
5252 }
5353 ocsData . attributes = ocsData . attributes ?? [ ]
@@ -310,7 +310,7 @@ export default class Share {
310310 * @memberof Share
311311 */
312312 get label ( ) {
313- return this . _share . label
313+ return this . _share . label ?? ''
314314 }
315315
316316 /**
Original file line number Diff line number Diff line change @@ -508,7 +508,7 @@ export default {
508508 return this .share .type === this .SHARE_TYPES .SHARE_TYPE_GROUP
509509 },
510510 isNewShare () {
511- return this .share .id === null || this . share . id === undefined
511+ return ! this .share .id
512512 },
513513 allowsFileDrop () {
514514 if (this .isFolder && this .config .isPublicUploadEnabled ) {
@@ -787,13 +787,10 @@ export default {
787787
788788 },
789789 handleShareType () {
790- if (this .share .share_type ) {
791- this .share .type = this .share .share_type
792- }
793- // shareType 0 (USER_SHARE) would evaluate to zero
794- // Hence the use of hasOwnProperty
795790 if (' shareType' in this .share ) {
796791 this .share .type = this .share .shareType
792+ } else if (this .share .share_type ) {
793+ this .share .type = this .share .share_type
797794 }
798795 },
799796 handleDefaultPermissions () {
@@ -814,7 +811,7 @@ export default {
814811 this .sharingPermission = ' custom'
815812 this .advancedSectionAccordionExpanded = true
816813 this .setCustomPermissions = true
817- } else {
814+ } else if ( this . share . permissions ) {
818815 this .sharingPermission = this .share .permissions .toString ()
819816 }
820817 },
You can’t perform that action at this time.
0 commit comments