MOBILE-4269 sync: Remove 'Error' from sync warning modals

main
Dani Palou 2023-04-05 10:20:16 +02:00
parent 8cb4b4ec6d
commit 708165c0e8
12 changed files with 15 additions and 15 deletions

View File

@ -313,7 +313,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy {
const result = await AddonCalendarSync.syncEvents();
if (result.warnings && result.warnings.length) {
CoreDomUtils.showErrorModal(result.warnings[0]);
CoreDomUtils.showAlert(undefined, result.warnings[0]);
}
if (result.updated) {

View File

@ -328,7 +328,7 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy {
try {
const result = await AddonCalendarSync.syncEvents();
if (result.warnings && result.warnings.length) {
CoreDomUtils.showErrorModal(result.warnings[0]);
CoreDomUtils.showAlert(undefined, result.warnings[0]);
}
if (result.deleted && result.deleted.indexOf(this.eventId) != -1) {

View File

@ -200,7 +200,7 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy {
try {
const result = await AddonCalendarSync.syncEvents();
if (result.warnings && result.warnings.length) {
CoreDomUtils.showErrorModal(result.warnings[0]);
CoreDomUtils.showAlert(undefined, result.warnings[0]);
}
if (result.updated) {

View File

@ -131,7 +131,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
// Show first warning if any.
if (data.warnings && data.warnings[0]) {
CoreDomUtils.showErrorModal(data.warnings[0]);
CoreDomUtils.showAlert(undefined, data.warnings[0]);
}
}
}, this.siteId);
@ -252,7 +252,7 @@ export class AddonMessagesDiscussionPage implements OnInit, OnDestroy, AfterView
try {
const syncResult = await AddonMessagesSync.syncDiscussion(this.conversationId, this.userId);
if (syncResult.warnings && syncResult.warnings[0]) {
CoreDomUtils.showErrorModal(syncResult.warnings[0]);
CoreDomUtils.showAlert(undefined, syncResult.warnings[0]);
}
} catch {
// Ignore errors;

View File

@ -372,7 +372,7 @@ export class AddonModAssignIndexComponent extends CoreCourseModuleMainActivityCo
if (syncEventData.warnings && syncEventData.warnings.length) {
// Show warnings.
CoreDomUtils.showErrorModal(syncEventData.warnings[0]);
CoreDomUtils.showAlert(undefined, syncEventData.warnings[0]);
}
return true;

View File

@ -611,7 +611,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
.syncDiscussionReplies(this.discussionId)
.then((result) => {
if (result.warnings && result.warnings.length) {
CoreDomUtils.showErrorModal(result.warnings[0]);
CoreDomUtils.showAlert(undefined, result.warnings[0]);
}
if (result && result.updated && this.forumId) {
@ -632,7 +632,7 @@ export class AddonModForumDiscussionPage implements OnInit, AfterViewInit, OnDes
.syncRatings(this.cmId, this.discussionId)
.then((result) => {
if (result.warnings && result.warnings.length) {
CoreDomUtils.showErrorModal(result.warnings[0]);
CoreDomUtils.showAlert(undefined, result.warnings[0]);
}
return;

View File

@ -402,7 +402,7 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy, CanLeave {
}
// Retake hasn't changed, show the warning and finish the retake in offline.
CoreDomUtils.showErrorModal(result.warnings[0]);
CoreDomUtils.showAlert(undefined, result.warnings[0]);
}
this.offline = false;

View File

@ -809,7 +809,7 @@ export class AddonModWikiIndexComponent extends CoreCourseModuleMainActivityComp
if (this.isCurrentView && syncEventData.warnings && syncEventData.warnings.length) {
// Show warnings.
CoreDomUtils.showErrorModal(syncEventData.warnings[0]);
CoreDomUtils.showAlert(undefined, syncEventData.warnings[0]);
}
// Check if current page was created or discarded.

View File

@ -290,7 +290,7 @@ export class AddonNotesListPage implements OnInit, OnDestroy {
const message = CoreTextUtils.buildMessage(warnings);
if (message) {
CoreDomUtils.showErrorModal(message);
CoreDomUtils.showAlert(undefined, message);
}
}

View File

@ -267,7 +267,7 @@ export class CoreCommentsViewerPage implements OnInit, OnDestroy {
private showSyncWarnings(warnings: string[]): void {
const message = CoreTextUtils.buildMessage(warnings);
if (message) {
CoreDomUtils.showErrorModal(message);
CoreDomUtils.showAlert(undefined, message);
}
}

View File

@ -216,7 +216,7 @@ export class CoreCourseModuleMainActivityComponent extends CoreCourseModuleMainR
const result = await this.sync();
if (result.warnings.length) {
CoreDomUtils.showErrorModal(result.warnings[0]);
CoreDomUtils.showAlert(undefined, result.warnings[0]);
}
return this.hasSyncSucceed(result);

View File

@ -152,7 +152,7 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy, CoreRefreshCon
this.showLoadingAndRefresh(false, false);
if (data.warnings && data.warnings[0]) {
CoreDomUtils.showErrorModal(data.warnings[0]);
CoreDomUtils.showAlert(undefined, data.warnings[0].message);
}
});
}
@ -183,7 +183,7 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy, CoreRefreshCon
this.course.displayname || this.course.fullname,
));
if (result?.warnings?.length) {
CoreDomUtils.showErrorModal(result.warnings[0]);
CoreDomUtils.showAlert(undefined, result.warnings[0].message);
}
}