Update SNJS

This commit is contained in:
Mo Bitar
2020-03-14 11:06:03 -05:00
parent 444c18bbde
commit 8fcfef08a6
22 changed files with 89726 additions and 68 deletions

View File

@@ -215,7 +215,7 @@ class AccountMenuCtrl extends PureCtrl {
mfa: null
});
if (error.message) {
this.application.alertManager.alert({
this.application.alertService.alert({
text: error.message
});
}
@@ -228,7 +228,7 @@ class AccountMenuCtrl extends PureCtrl {
async register() {
const confirmation = this.state.formData.password_conf;
if (confirmation !== this.state.formData.user_password) {
this.application.alertManager.alert({
this.application.alertService.alert({
text: STRING_NON_MATCHING_PASSWORDS
});
return;
@@ -254,7 +254,7 @@ class AccountMenuCtrl extends PureCtrl {
await this.setFormDataState({
authenticating: false
});
this.application.alertManager.alert({
this.application.alertService.alert({
text: error.message
});
} else {
@@ -265,7 +265,7 @@ class AccountMenuCtrl extends PureCtrl {
mergeLocalChanged() {
if (!this.state.formData.mergeLocal) {
this.application.alertManager.confirm({
this.application.alertService.confirm({
text: STRING_ACCOUNT_MENU_UNCHECK_MERGE,
destructive: true,
onCancel: () => {
@@ -303,7 +303,7 @@ class AccountMenuCtrl extends PureCtrl {
}
destroyLocalData() {
this.application.alertManager.confirm({
this.application.alertService.confirm({
text: STRING_SIGN_OUT_CONFIRMATION,
destructive: true,
onConfirm: async () => {
@@ -327,7 +327,7 @@ class AccountMenuCtrl extends PureCtrl {
const data = JSON.parse(e.target.result);
resolve(data);
} catch (e) {
this.application.alertManager.alert({
this.application.alertService.alert({
text: STRING_INVALID_IMPORT_FILE
});
}
@@ -390,11 +390,11 @@ class AccountMenuCtrl extends PureCtrl {
});
if (errorCount > 0) {
const message = StringImportError({ errorCount: errorCount });
this.application.alertManager.alert({
this.application.alertService.alert({
text: message
});
} else {
this.application.alertManager.alert({
this.application.alertService.alert({
text: STRING_IMPORT_SUCCESS
});
}
@@ -471,7 +471,7 @@ class AccountMenuCtrl extends PureCtrl {
submitPasscodeForm() {
const passcode = this.state.formData.passcode;
if (passcode !== this.state.formData.confirmPasscode) {
this.application.alertManager.alert({
this.application.alertService.alert({
text: STRING_NON_MATCHING_PASSCODES
});
return;
@@ -513,7 +513,7 @@ class AccountMenuCtrl extends PureCtrl {
if (!signedIn) {
message += STRING_REMOVE_PASSCODE_OFFLINE_ADDENDUM;
}
this.application.alertManager.confirm({
this.application.alertService.confirm({
text: message,
destructive: true,
onConfirm: () => {

View File

@@ -27,7 +27,7 @@ class ConflictResolutionCtrl {
}
keepItem1() {
this.application.alertManager.confirm({
this.application.alertService.confirm({
text: `Are you sure you want to delete the item on the right?`,
destructive: true,
onConfirm: () => {
@@ -39,7 +39,7 @@ class ConflictResolutionCtrl {
}
keepItem2() {
this.application.alertManager.confirm({
this.application.alertService.confirm({
text: `Are you sure you want to delete the item on the left?`,
destructive: true,
onConfirm: () => {

View File

@@ -101,20 +101,20 @@ class PasswordWizardCtrl extends PureCtrl {
const currentPassword = this.state.formData.currentPassword;
const newPass = this.props.securityUpdate ? currentPassword : this.state.formData.newPassword;
if (!currentPassword || currentPassword.length === 0) {
this.application.alertManager.alert({
this.application.alertService.alert({
text: "Please enter your current password."
});
return false;
}
if (this.props.changePassword) {
if (!newPass || newPass.length === 0) {
this.application.alertManager.alert({
this.application.alertService.alert({
text: "Please enter a new password."
});
return false;
}
if (newPass !== this.state.formData.newPasswordConfirmation) {
this.application.alertManager.alert({
this.application.alertService.alert({
text: "Your new password does not match its confirmation."
});
this.state.formData.status = null;
@@ -122,7 +122,7 @@ class PasswordWizardCtrl extends PureCtrl {
}
}
if (!this.application.getUser().email) {
this.application.alertManager.alert({
this.application.alertService.alert({
text: "We don't have your email stored. Please log out then log back in to fix this issue."
});
this.state.formData.status = null;
@@ -134,7 +134,7 @@ class PasswordWizardCtrl extends PureCtrl {
password: this.state.formData.currentPassword
});
if (!success) {
this.application.alertManager.alert({
this.application.alertService.alert({
text: "The current password you entered is not correct. Please try again."
});
}
@@ -163,7 +163,7 @@ class PasswordWizardCtrl extends PureCtrl {
processing: success
});
if (!success) {
this.application.alertManager.alert({
this.application.alertService.alert({
text: response.error.message
? response.error.message
: "There was an error changing your password. Please try again."
@@ -187,7 +187,7 @@ class PasswordWizardCtrl extends PureCtrl {
dismiss() {
if (this.state.lockContinue) {
this.application.alertManager.alert({
this.application.alertService.alert({
text: "Cannot close window until pending tasks are complete."
});
} else {

View File

@@ -99,7 +99,7 @@ class RevisionPreviewModalCtrl {
};
if (!asCopy) {
this.application.alertManager.confirm({
this.application.alertService.confirm({
text: "Are you sure you want to replace the current note's contents with what you see in this preview?",
destructive: true,
onConfirm: run

View File

@@ -45,7 +45,7 @@ class SessionHistoryMenuCtrl {
}
clearItemHistory() {
this.application.alertManager.confirm({
this.application.alertService.confirm({
text: "Are you sure you want to delete the local session history for this note?",
destructive: true,
onConfirm: () => {
@@ -59,7 +59,7 @@ class SessionHistoryMenuCtrl {
}
clearAllHistory() {
this.application.alertManager.confirm({
this.application.alertService.confirm({
text: "Are you sure you want to delete the local session history for all notes?",
destructive: true,
onConfirm: () => {
@@ -81,7 +81,7 @@ class SessionHistoryMenuCtrl {
});
};
if (!this.application.historyManager.diskEnabled) {
this.application.alertManager.confirm({
this.application.alertService.confirm({
text: `Are you sure you want to save history to disk? This will decrease general
performance, especially as you type. You are advised to disable this feature
if you experience any lagging.`,