From a02ee3a08bac55c9f0b29cb6bc0a15726b7cc3c8 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 8 Apr 2018 03:58:11 +0900 Subject: Some bug fixes --- .../app/mobile/views/components/note-detail.vue | 4 +- src/client/app/mobile/views/components/note.vue | 32 +- .../app/mobile/views/components/post-detail.vue | 462 ------------------ .../app/mobile/views/components/post-form.vue | 2 +- src/client/app/mobile/views/components/post.vue | 540 --------------------- .../app/mobile/views/components/ui.header.vue | 4 +- src/client/app/mobile/views/pages/home.vue | 20 +- .../app/mobile/views/pages/profile-setting.vue | 4 +- src/client/app/mobile/views/pages/user.vue | 10 +- src/client/app/mobile/views/pages/user/home.vue | 2 +- src/client/app/mobile/views/pages/welcome.vue | 4 +- 11 files changed, 36 insertions(+), 1048 deletions(-) delete mode 100644 src/client/app/mobile/views/components/post-detail.vue delete mode 100644 src/client/app/mobile/views/components/post.vue (limited to 'src/client/app/mobile') diff --git a/src/client/app/mobile/views/components/note-detail.vue b/src/client/app/mobile/views/components/note-detail.vue index e1682e58ed..483f5aaf3b 100644 --- a/src/client/app/mobile/views/components/note-detail.vue +++ b/src/client/app/mobile/views/components/note-detail.vue @@ -127,7 +127,7 @@ export default Vue.extend({ isRenote(): boolean { return (this.note.renote && this.note.text == null && - this.note.mediaIds == null && + this.note.mediaIds.length == 0 && this.note.poll == null); }, p(): any { @@ -165,7 +165,7 @@ export default Vue.extend({ // Draw map if (this.p.geo) { - const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.account.clientSettings.showMaps : true; + const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.clientSettings.showMaps : true; if (shouldShowMap) { (this as any).os.getGoogleMaps().then(maps => { const uluru = new maps.LatLng(this.p.geo.coordinates[1], this.p.geo.coordinates[0]); diff --git a/src/client/app/mobile/views/components/note.vue b/src/client/app/mobile/views/components/note.vue index 4b33c6f071..295fe4d6a8 100644 --- a/src/client/app/mobile/views/components/note.vue +++ b/src/client/app/mobile/views/components/note.vue @@ -5,25 +5,25 @@

- + avatar %fa:retweet% {{ '%i18n:mobile.tags.mk-timeline-note.reposted-by%'.substr(0, '%i18n:mobile.tags.mk-timeline-note.reposted-by%'.indexOf('{')) }} - {{ name }} + {{ getUserName(note.user) }} {{ '%i18n:mobile.tags.mk-timeline-note.reposted-by%'.substr('%i18n:mobile.tags.mk-timeline-note.reposted-by%'.indexOf('}') + 1) }}

- + avatar
- {{ pName }} - bot - @{{ pAcct }} + {{ getUserName(p.user) }} + bot + @{{ getAcct(p.user) }}
%fa:mobile-alt% @@ -95,27 +95,17 @@ export default Vue.extend({ data() { return { connection: null, - connectionId: null + connectionId: null, + getAcct, + getUserName }; }, computed: { - acct(): string { - return getAcct(this.note.user); - }, - name(): string { - return getUserName(this.note.user); - }, - pAcct(): string { - return getAcct(this.p.user); - }, - pName(): string { - return getUserName(this.p.user); - }, isRenote(): boolean { return (this.note.renote && this.note.text == null && - this.note.mediaIds == null && + this.note.mediaIds.length == 0 && this.note.poll == null); }, p(): any { @@ -159,7 +149,7 @@ export default Vue.extend({ // Draw map if (this.p.geo) { - const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.account.clientSettings.showMaps : true; + const shouldShowMap = (this as any).os.isSignedIn ? (this as any).os.i.clientSettings.showMaps : true; if (shouldShowMap) { (this as any).os.getGoogleMaps().then(maps => { const uluru = new maps.LatLng(this.p.geo.coordinates[1], this.p.geo.coordinates[0]); diff --git a/src/client/app/mobile/views/components/post-detail.vue b/src/client/app/mobile/views/components/post-detail.vue deleted file mode 100644 index e1682e58ed..0000000000 --- a/src/client/app/mobile/views/components/post-detail.vue +++ /dev/null @@ -1,462 +0,0 @@ - - - - - - - diff --git a/src/client/app/mobile/views/components/post-form.vue b/src/client/app/mobile/views/components/post-form.vue index 6fcbbb47e8..70be6db7b2 100644 --- a/src/client/app/mobile/views/components/post-form.vue +++ b/src/client/app/mobile/views/components/post-form.vue @@ -111,7 +111,7 @@ export default Vue.extend({ }, post() { this.posting = true; - const viaMobile = (this as any).os.i.account.clientSettings.disableViaMobile !== true; + const viaMobile = (this as any).os.i.clientSettings.disableViaMobile !== true; (this as any).api('notes/create', { text: this.text == '' ? undefined : this.text, mediaIds: this.files.length > 0 ? this.files.map(f => f.id) : undefined, diff --git a/src/client/app/mobile/views/components/post.vue b/src/client/app/mobile/views/components/post.vue deleted file mode 100644 index 4b33c6f071..0000000000 --- a/src/client/app/mobile/views/components/post.vue +++ /dev/null @@ -1,540 +0,0 @@ - - - - - - - diff --git a/src/client/app/mobile/views/components/ui.header.vue b/src/client/app/mobile/views/components/ui.header.vue index fd4f31fd98..f664341cdd 100644 --- a/src/client/app/mobile/views/components/ui.header.vue +++ b/src/client/app/mobile/views/components/ui.header.vue @@ -63,9 +63,9 @@ export default Vue.extend({ } }); - const ago = (new Date().getTime() - new Date((this as any).os.i.account.lastUsedAt).getTime()) / 1000 + const ago = (new Date().getTime() - new Date((this as any).os.i.lastUsedAt).getTime()) / 1000 const isHisasiburi = ago >= 3600; - (this as any).os.i.account.lastUsedAt = new Date(); + (this as any).os.i.lastUsedAt = new Date(); if (isHisasiburi) { (this.$refs.welcomeback as any).style.display = 'block'; (this.$refs.main as any).style.overflow = 'hidden'; diff --git a/src/client/app/mobile/views/pages/home.vue b/src/client/app/mobile/views/pages/home.vue index ab61166cf3..3de2ba1c3e 100644 --- a/src/client/app/mobile/views/pages/home.vue +++ b/src/client/app/mobile/views/pages/home.vue @@ -82,8 +82,8 @@ export default Vue.extend({ }; }, created() { - if ((this as any).os.i.account.clientSettings.mobileHome == null) { - Vue.set((this as any).os.i.account.clientSettings, 'mobileHome', [{ + if ((this as any).os.i.clientSettings.mobileHome == null) { + Vue.set((this as any).os.i.clientSettings, 'mobileHome', [{ name: 'calendar', id: 'a', data: {} }, { @@ -105,14 +105,14 @@ export default Vue.extend({ name: 'version', id: 'g', data: {} }]); - this.widgets = (this as any).os.i.account.clientSettings.mobileHome; + this.widgets = (this as any).os.i.clientSettings.mobileHome; this.saveHome(); } else { - this.widgets = (this as any).os.i.account.clientSettings.mobileHome; + this.widgets = (this as any).os.i.clientSettings.mobileHome; } - this.$watch('os.i.account.clientSettings', i => { - this.widgets = (this as any).os.i.account.clientSettings.mobileHome; + this.$watch('os.i.clientSettings', i => { + this.widgets = (this as any).os.i.clientSettings.mobileHome; }, { deep: true }); @@ -157,15 +157,15 @@ export default Vue.extend({ }, onHomeUpdated(data) { if (data.home) { - (this as any).os.i.account.clientSettings.mobileHome = data.home; + (this as any).os.i.clientSettings.mobileHome = data.home; this.widgets = data.home; } else { - const w = (this as any).os.i.account.clientSettings.mobileHome.find(w => w.id == data.id); + const w = (this as any).os.i.clientSettings.mobileHome.find(w => w.id == data.id); if (w != null) { w.data = data.data; this.$refs[w.id][0].preventSave = true; this.$refs[w.id][0].props = w.data; - this.widgets = (this as any).os.i.account.clientSettings.mobileHome; + this.widgets = (this as any).os.i.clientSettings.mobileHome; } } }, @@ -194,7 +194,7 @@ export default Vue.extend({ this.saveHome(); }, saveHome() { - (this as any).os.i.account.clientSettings.mobileHome = this.widgets; + (this as any).os.i.clientSettings.mobileHome = this.widgets; (this as any).api('i/update_mobile_home', { home: this.widgets }); diff --git a/src/client/app/mobile/views/pages/profile-setting.vue b/src/client/app/mobile/views/pages/profile-setting.vue index 4a560c0272..7f0ff5aad7 100644 --- a/src/client/app/mobile/views/pages/profile-setting.vue +++ b/src/client/app/mobile/views/pages/profile-setting.vue @@ -53,9 +53,9 @@ export default Vue.extend({ }, created() { this.name = (this as any).os.i.name || ''; - this.location = (this as any).os.i.account.profile.location; + this.location = (this as any).os.i.profile.location; this.description = (this as any).os.i.description; - this.birthday = (this as any).os.i.account.profile.birthday; + this.birthday = (this as any).os.i.profile.birthday; }, mounted() { document.title = 'Misskey | %i18n:mobile.tags.mk-profile-setting-page.title%'; diff --git a/src/client/app/mobile/views/pages/user.vue b/src/client/app/mobile/views/pages/user.vue index 08fa4e2774..f33f209db1 100644 --- a/src/client/app/mobile/views/pages/user.vue +++ b/src/client/app/mobile/views/pages/user.vue @@ -18,11 +18,11 @@
{{ user.description }}
-

- %fa:map-marker%{{ user.account.profile.location }} +

+ %fa:map-marker%{{ user.profile.location }}

-

- %fa:birthday-cake%{{ user.account.profile.birthday.replace('-', '年').replace('-', '月') + '日' }} ({{ age }}歳) +

+ %fa:birthday-cake%{{ user.profile.birthday.replace('-', '年').replace('-', '月') + '日' }} ({{ age }}歳)

@@ -81,7 +81,7 @@ export default Vue.extend({ return this.getAcct(this.user); }, age(): number { - return age(this.user.account.profile.birthday); + return age(this.user.profile.birthday); }, name() { return getUserName(this.user); diff --git a/src/client/app/mobile/views/pages/user/home.vue b/src/client/app/mobile/views/pages/user/home.vue index 2554084969..c0cd9b8da8 100644 --- a/src/client/app/mobile/views/pages/user/home.vue +++ b/src/client/app/mobile/views/pages/user/home.vue @@ -31,7 +31,7 @@
-

%i18n:mobile.tags.mk-user-overview.last-used-at%:

+

%i18n:mobile.tags.mk-user-overview.last-used-at%:

diff --git a/src/client/app/mobile/views/pages/welcome.vue b/src/client/app/mobile/views/pages/welcome.vue index 17cdf93065..27baf8bee4 100644 --- a/src/client/app/mobile/views/pages/welcome.vue +++ b/src/client/app/mobile/views/pages/welcome.vue @@ -8,7 +8,7 @@
- +
@@ -70,7 +70,7 @@ export default Vue.extend({ (this as any).api('signin', { username: this.username, password: this.password, - token: this.user && this.user.account.twoFactorEnabled ? this.token : undefined + token: this.user && this.user.twoFactorEnabled ? this.token : undefined }).then(() => { location.reload(); }).catch(() => { -- cgit v1.2.3-freya