From 11afa8140c5706c8ad105e50cef63df83db66e7a Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 14 Nov 2018 16:30:58 +0900 Subject: [Client] Improve alert component --- src/client/app/desktop/api/update-avatar.ts | 14 ++++---------- src/client/app/desktop/api/update-banner.ts | 12 +++--------- 2 files changed, 7 insertions(+), 19 deletions(-) (limited to 'src/client/app/desktop/api') diff --git a/src/client/app/desktop/api/update-avatar.ts b/src/client/app/desktop/api/update-avatar.ts index ae8b723ea6..e0215aa34f 100644 --- a/src/client/app/desktop/api/update-avatar.ts +++ b/src/client/app/desktop/api/update-avatar.ts @@ -8,12 +8,9 @@ export default ($root: any) => { const regex = RegExp('\.(jpg|jpeg|png|gif|webp|bmp|tiff)$'); if (!regex.test(file.name) ) { - $root.$dialog({ + $root.alert({ title: '%fa:info-circle% %i18n:desktop.invalid-filetype%', - text: null, - actions: [{ - text: '%i18n:common.got-it%' - }] + text: null }); return reject('invalid-filetype'); } @@ -90,12 +87,9 @@ export default ($root: any) => { value: i.avatarUrl }); - $root.$dialog({ + $root.alert({ title: '%fa:info-circle% %i18n:desktop.avatar-updated%', - text: null, - actions: [{ - text: '%i18n:common.got-it%' - }] + text: null }); return i; diff --git a/src/client/app/desktop/api/update-banner.ts b/src/client/app/desktop/api/update-banner.ts index c338d4e95c..36582684ec 100644 --- a/src/client/app/desktop/api/update-banner.ts +++ b/src/client/app/desktop/api/update-banner.ts @@ -10,10 +10,7 @@ export default ($root: any) => { if (!regex.test(file.name) ) { $root.dialog({ title: '%fa:info-circle% %i18n:desktop.invalid-filetype%', - text: null, - actions: [{ - text: '%i18n:common.got-it%' - }] + text: null }); return reject('invalid-filetype'); } @@ -90,12 +87,9 @@ export default ($root: any) => { value: i.bannerUrl }); - $root.$dialog({ + $root.alert({ title: '%fa:info-circle% %i18n:desktop.banner-updated%', - text: null, - actions: [{ - text: '%i18n:common.got-it%' - }] + text: null }); return i; -- cgit v1.2.3-freya