To able to store local only visibilities (#3298)

This commit is contained in:
MeiMei
2018-11-17 13:21:40 +09:00
committed by syuilo
parent 6c72545fc8
commit 35db61f1b4
4 changed files with 36 additions and 27 deletions

View File

@ -111,7 +111,7 @@ export default Vue.extend({
useCw: false,
cw: null,
geo: null,
visibility: this.$store.state.settings.rememberNoteVisibility ? (this.$store.state.device.visibility || this.$store.state.settings.defaultNoteVisibility) : this.$store.state.settings.defaultNoteVisibility,
visibility: 'public',
visibleUsers: [],
localOnly: false,
autocomplete: null,
@ -195,6 +195,9 @@ export default Vue.extend({
});
}
// デフォルト公開範囲
this.applyVisibility(this.$store.state.settings.rememberNoteVisibility ? (this.$store.state.device.visibility || this.$store.state.settings.defaultNoteVisibility) : this.$store.state.settings.defaultNoteVisibility);
// 公開以外へのリプライ時は元の公開範囲を引き継ぐ
if (this.reply && ['home', 'followers', 'specified', 'private'].includes(this.reply.visibility)) {
this.visibility = this.reply.visibility;
@ -365,17 +368,21 @@ export default Vue.extend({
source: this.$refs.visibilityButton
});
w.$once('chosen', v => {
const m = v.match(/^local-(.+)/);
if (m) {
this.localOnly = true;
this.visibility = m[1];
} else {
this.localOnly = false;
this.visibility = v;
}
this.applyVisibility(v);
});
},
applyVisibility(v :string) {
const m = v.match(/^local-(.+)/);
if (m) {
this.localOnly = true;
this.visibility = m[1];
} else {
this.localOnly = false;
this.visibility = v;
}
},
addVisibleUser() {
this.$input({
title: this.$t('enter-username')