refactor(client):

This commit is contained in:
syuilo
2020-04-22 19:36:28 +09:00
parent 51476ad06f
commit 6e3ee05cb6
7 changed files with 28 additions and 47 deletions

View File

@ -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
});
}

View File

@ -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,
},

View File

@ -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]);
});
});
});
}

View File

@ -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]));
});
});
});
}