diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-04-22 19:36:28 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-04-22 19:36:28 +0900 |
| commit | 6e3ee05cb6b88fce13d1c73aea0085d09cf3f0ba (patch) | |
| tree | 0f9ce1b9fa890c4f31c0b474758210a1633499c2 /src/client | |
| parent | New Crowdin translations (#6281) (diff) | |
| download | sharkey-6e3ee05cb6b88fce13d1c73aea0085d09cf3f0ba.tar.gz sharkey-6e3ee05cb6b88fce13d1c73aea0085d09cf3f0ba.tar.bz2 sharkey-6e3ee05cb6b88fce13d1c73aea0085d09cf3f0ba.zip | |
refactor(client): :sparkles:
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app.vue | 5 | ||||
| -rw-r--r-- | src/client/pages/index.home.vue | 3 | ||||
| -rw-r--r-- | src/client/scripts/select-drive-file.ts | 16 | ||||
| -rw-r--r-- | src/client/scripts/select-drive-folder.ts | 16 |
4 files changed, 19 insertions, 21 deletions
diff --git a/src/client/app.vue b/src/client/app.vue index f3f99fe282..4bc5710212 100644 --- a/src/client/app.vue +++ b/src/client/app.vue @@ -163,7 +163,6 @@ import { v4 as uuid } from 'uuid'; import i18n from './i18n'; import { host, instanceName } from './config'; import { search } from './scripts/search'; -import MkToast from './components/toast.vue'; const DESKTOP_THRESHOLD = 1100; @@ -535,14 +534,14 @@ export default Vue.extend({ }); }, - onNotification(notification) { + async onNotification(notification) { // TODO: ユーザーが画面を見てないと思われるとき(ブラウザやタブがアクティブじゃないなど)は送信しない if (true) { this.$root.stream.send('readNotification', { id: notification.id }); - this.$root.new(MkToast, { + this.$root.new(await import('./components/toast.vue').then(m => m.default), { notification }); } diff --git a/src/client/pages/index.home.vue b/src/client/pages/index.home.vue index 60035da929..17d07e6084 100644 --- a/src/client/pages/index.home.vue +++ b/src/client/pages/index.home.vue @@ -29,7 +29,6 @@ import { faAngleDown, faAngleUp, faHome, faShareAlt, faGlobe, faListUl, faSatell import { faComments } from '@fortawesome/free-regular-svg-icons'; import Progress from '../scripts/loading'; import XTimeline from '../components/timeline.vue'; -import XTutorial from './index.home.tutorial.vue'; import XPostForm from '../components/post-form.vue'; export default Vue.extend({ @@ -41,7 +40,7 @@ export default Vue.extend({ components: { XTimeline, - XTutorial, + XTutorial: () => import('./index.home.tutorial.vue').then(m => m.default), XPostForm, }, diff --git a/src/client/scripts/select-drive-file.ts b/src/client/scripts/select-drive-file.ts index 798c270e3f..3a4ac70007 100644 --- a/src/client/scripts/select-drive-file.ts +++ b/src/client/scripts/select-drive-file.ts @@ -1,13 +1,13 @@ -import DriveWindow from '../components/drive-window.vue'; - export function selectDriveFile($root: any, multiple) { return new Promise((res, rej) => { - const w = $root.new(DriveWindow, { - type: 'file', - multiple - }); - w.$once('selected', files => { - res(multiple ? files : files[0]); + import('../components/drive-window.vue').then(m => m.default).then(dialog => { + const w = $root.new(dialog, { + type: 'file', + multiple + }); + w.$once('selected', files => { + res(multiple ? files : files[0]); + }); }); }); } diff --git a/src/client/scripts/select-drive-folder.ts b/src/client/scripts/select-drive-folder.ts index 68516e1010..313d552e3a 100644 --- a/src/client/scripts/select-drive-folder.ts +++ b/src/client/scripts/select-drive-folder.ts @@ -1,13 +1,13 @@ -import DriveWindow from '../components/drive-window.vue'; - export function selectDriveFolder($root: any, multiple) { return new Promise((res, rej) => { - const w = $root.new(DriveWindow, { - type: 'folder', - multiple - }); - w.$once('selected', folders => { - res(multiple ? folders : (folders.length === 0 ? null : folders[0])); + import('../components/drive-window.vue').then(m => m.default).then(dialog => { + const w = $root.new(dialog, { + type: 'folder', + multiple + }); + w.$once('selected', folders => { + res(multiple ? folders : (folders.length === 0 ? null : folders[0])); + }); }); }); } |