1616 {{ $t("message.share.close") }}
1717 </c-button >
1818 </header >
19- <c-card-content >
19+ <c-card-content id = " share-card-modal-content " >
2020 <h6 class =" subtitle is-6 has-text-dark" >
2121 {{ $t("message.share.share_subtitle") }}
2222 </h6 >
8686 </c-flex >
8787 </c-container >
8888 <c-alert
89- v-show =" isShared || isPermissionRemoved"
89+ v-show =" isShared || isPermissionRemoved || isPermissionUpdated "
9090 type =" success"
9191 >
9292 <div class =" shared-notification" >
9393 {{ isShared ? $t('message.share.shared_successfully')
94- : $t('message.share.remove_permission')
94+ : isPermissionUpdated ? $t('message.share.update_permission')
95+ : $t('message.share.remove_permission')
9596 }}
9697 <c-button
9798 text
111112 :folder-name =" folderName"
112113 :access-rights =" accessRights"
113114 @removeSharedFolder =" removeSharedFolder"
115+ @updateSharedFolder =" updateSharedFolder"
114116 />
115117 </c-container >
116118 </c-card-content >
@@ -143,6 +145,7 @@ export default {
143145 isShared: false ,
144146 sharedDetails: [],
145147 isPermissionRemoved: false ,
148+ isPermissionUpdated: false ,
146149 timeout: null ,
147150 };
148151 },
@@ -207,18 +210,10 @@ export default {
207210 (ret ) => {
208211 this .loading = false ;
209212 if (ret) {
210- this .isShared = true ;
211213 this .getSharedDetails ();
212-
213- if (this .timeout !== null ) {
214- clearTimeout (this .timeout );
215- this .timeout = null ;
216- if (this .isPermissionRemoved ) {
217- this .isPermissionRemoved = false ;
218- }
219- }
220- this .timeout = setTimeout (
221- () => this .closeSharedNotification (), 3000 );
214+ this .closeSharedNotification ();
215+ this .isShared = true ;
216+ this .closeSharedNotificationWithTimeout ();
222217 }
223218 },
224219 );
@@ -302,8 +297,18 @@ export default {
302297 this .isShared = false ;
303298 this .isPermissionRemoved = false ;
304299 },
300+ closeSharedNotificationWithTimeout () {
301+ document .getElementById (" share-card-modal-content" ).scrollTo (0 , 0 );
302+ this .timeout = setTimeout (() => this .closeSharedNotification (), 3000 );
303+ },
305304 closeSharedNotification : function () {
306- this .isShared ? this .isShared = false : this .isPermissionRemoved = false ;
305+ if (this .timeout !== null ) {
306+ clearTimeout (this .timeout );
307+ }
308+
309+ this .isShared = false ;
310+ this .isPermissionRemoved = false ;
311+ this .isPermissionUpdated = false ;
307312 },
308313 getSharedDetails : function () {
309314 this .$store .state .client .getShareDetails (
@@ -314,21 +319,19 @@ export default {
314319 this .tags = [];
315320 });
316321 },
322+ updateSharedFolder : function () {
323+ this .closeSharedNotification ();
324+ this .isPermissionUpdated = true ;
325+ this .closeSharedNotificationWithTimeout ();
326+ },
317327 removeSharedFolder : function (folderData ) {
328+ this .closeSharedNotification ();
318329 this .sharedDetails = this .sharedDetails .filter (
319330 item => {
320331 return item .sharedTo !== folderData .projectId .value ;
321332 });
322333 this .isPermissionRemoved = true ;
323-
324- if (this .timeout !== null ) {
325- clearTimeout (this .timeout );
326- this .timeout = null ;
327- if (this .isShared ) {
328- this .isShared = false ;
329- }
330- }
331- this .timeout = setTimeout (() => this .isPermissionRemoved = false , 3000 );
334+ this .closeSharedNotificationWithTimeout ();
332335 },
333336 },
334337};
0 commit comments