リファクタリングなど

This commit is contained in:
syuilo 2018-04-29 17:17:15 +09:00
parent 1625b37b44
commit 372bfaceda
64 changed files with 521 additions and 570 deletions

View file

@ -64,8 +64,8 @@ export default Vue.extend({
};
},
created() {
if ((this as any).os.i.clientSettings.mobileHome == null) {
Vue.set((this as any).os.i.clientSettings, 'mobileHome', [{
if ((this as any).clientSettings.mobileHome == null) {
Vue.set((this as any).clientSettings, 'mobileHome', [{
name: 'calendar',
id: 'a', data: {}
}, {
@ -87,14 +87,14 @@ export default Vue.extend({
name: 'version',
id: 'g', data: {}
}]);
this.widgets = (this as any).os.i.clientSettings.mobileHome;
this.widgets = (this as any).clientSettings.mobileHome;
this.saveHome();
} else {
this.widgets = (this as any).os.i.clientSettings.mobileHome;
this.widgets = (this as any).clientSettings.mobileHome;
}
this.$watch('os.i.clientSettings', i => {
this.widgets = (this as any).os.i.clientSettings.mobileHome;
this.$watch('clientSettings', i => {
this.widgets = (this as any).clientSettings.mobileHome;
}, {
deep: true
});
@ -107,15 +107,15 @@ export default Vue.extend({
methods: {
onHomeUpdated(data) {
if (data.home) {
(this as any).os.i.clientSettings.mobileHome = data.home;
(this as any).clientSettings.mobileHome = data.home;
this.widgets = data.home;
} else {
const w = (this as any).os.i.clientSettings.mobileHome.find(w => w.id == data.id);
const w = (this as any).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.clientSettings.mobileHome;
this.widgets = (this as any).clientSettings.mobileHome;
}
}
},
@ -144,7 +144,7 @@ export default Vue.extend({
this.saveHome();
},
saveHome() {
(this as any).os.i.clientSettings.mobileHome = this.widgets;
(this as any).clientSettings.mobileHome = this.widgets;
(this as any).api('i/update_mobile_home', {
home: this.widgets
});

View file

@ -92,8 +92,8 @@ export default Vue.extend({
(this as any).api(this.endpoint, {
limit: fetchLimit + 1,
untilDate: this.date ? this.date.getTime() : undefined,
includeMyRenotes: (this as any).os.i.clientSettings.showMyRenotes,
includeRenotedMyNotes: (this as any).os.i.clientSettings.showRenotedMyNotes
includeMyRenotes: (this as any).clientSettings.showMyRenotes,
includeRenotedMyNotes: (this as any).clientSettings.showRenotedMyNotes
}).then(notes => {
if (notes.length == fetchLimit + 1) {
notes.pop();
@ -114,8 +114,8 @@ export default Vue.extend({
(this as any).api(this.endpoint, {
limit: fetchLimit + 1,
untilId: (this.$refs.timeline as any).tail().id,
includeMyRenotes: (this as any).os.i.clientSettings.showMyRenotes,
includeRenotedMyNotes: (this as any).os.i.clientSettings.showRenotedMyNotes
includeMyRenotes: (this as any).clientSettings.showMyRenotes,
includeRenotedMyNotes: (this as any).clientSettings.showRenotedMyNotes
}).then(notes => {
if (notes.length == fetchLimit + 1) {
notes.pop();

View file

@ -22,9 +22,7 @@
<mk-welcome-timeline/>
</div>
<div class="users">
<router-link v-for="user in users" :key="user.id" class="avatar-anchor" :to="`/@${user.username}`">
<img class="avatar" :src="`${user.avatarUrl}?thumbnail&size=64`" alt="avatar"/>
</router-link>
<mk-avatar class="avatar" :key="user.id" :user="user"/>
</div>
<footer>
<small>{{ copyright }}</small>