Skip to content

Commit cdd1a8c

Browse files
committed
feat: Require email confirmation before sharing
1 parent 98bd10c commit cdd1a8c

File tree

1 file changed

+25
-24
lines changed

1 file changed

+25
-24
lines changed

src/gui/src/UI/UIItem.js

+25-24
Original file line numberDiff line numberDiff line change
@@ -786,18 +786,18 @@ function UIItem(options){
786786
menu_items.push({
787787
html: 'Share With…',
788788
onClick: async function(){
789-
// if(window.user.is_temp &&
790-
// !await UIWindowSaveAccount({
791-
// message: 'Please create an account to proceed.',
792-
// send_confirmation_code: true,
793-
// window_options: {
794-
// backdrop: true,
795-
// close_on_backdrop_click: false,
796-
// }
797-
// },))
798-
// return;
799-
// else if(!window.user.email_confirmed && !await UIWindowEmailConfirmationRequired())
800-
// return;
789+
if(window.user.is_temp &&
790+
!await UIWindowSaveAccount({
791+
send_confirmation_code: true,
792+
message: 'Please create an account to proceed.',
793+
window_options: {
794+
backdrop: true,
795+
close_on_backdrop_click: false,
796+
}
797+
}))
798+
return;
799+
else if(!window.user.email_confirmed && !await UIWindowEmailConfirmationRequired())
800+
return;
801801

802802
let items = [];
803803
$selected_items.each(function() {
@@ -1090,18 +1090,19 @@ function UIItem(options){
10901090
menu_items.push({
10911091
html: 'Share With…',
10921092
onClick: async function(){
1093-
// if(window.user.is_temp &&
1094-
// !await UIWindowSaveAccount({
1095-
// message: 'Please create an account to proceed.',
1096-
// send_confirmation_code: true,
1097-
// window_options: {
1098-
// backdrop: true,
1099-
// close_on_backdrop_click: false,
1100-
// }
1101-
// }))
1102-
// return;
1103-
// else if(!window.user.email_confirmed && !await UIWindowEmailConfirmationRequired())
1104-
// return;
1093+
if(window.user.is_temp &&
1094+
!await UIWindowSaveAccount({
1095+
send_confirmation_code: true,
1096+
message: 'Please create an account to proceed.',
1097+
window_options: {
1098+
backdrop: true,
1099+
close_on_backdrop_click: false,
1100+
}
1101+
}))
1102+
return;
1103+
else if(!window.user.email_confirmed && !await UIWindowEmailConfirmationRequired())
1104+
return;
1105+
11051106
UIWindowShare([{uid: $(el_item).attr('data-uid'), path: $(el_item).attr('data-path'), name: $(el_item).attr('data-name'), icon: $(el_item_icon).find('img').attr('src')}]);
11061107
}
11071108
});

0 commit comments

Comments
 (0)