local only visibility (#3254)

* local only visibility

* fix UI
This commit is contained in:
MeiMei
2018-11-16 05:47:29 +09:00
committed by syuilo
parent aaaaf2681a
commit bceb02d760
15 changed files with 139 additions and 11 deletions

View File

@ -102,6 +102,7 @@ export default Vue.extend({
geo: null,
visibility: this.$store.state.settings.rememberNoteVisibility ? (this.$store.state.device.visibility || this.$store.state.settings.defaultNoteVisibility) : this.$store.state.settings.defaultNoteVisibility,
visibleUsers: [],
localOnly: false,
useCw: false,
cw: null,
recentHashtags: JSON.parse(localStorage.getItem('hashtags') || '[]'),
@ -274,7 +275,14 @@ export default Vue.extend({
compact: true
});
w.$once('chosen', v => {
this.visibility = v;
const m = v.match(/^local-(.+)/);
if (m) {
this.localOnly = true;
this.visibility = m[1];
} else {
this.localOnly = false;
this.visibility = v;
}
});
},
@ -320,6 +328,7 @@ export default Vue.extend({
} : null,
visibility: this.visibility,
visibleUserIds: this.visibility == 'specified' ? this.visibleUsers.map(u => u.id) : undefined,
localOnly: this.localOnly,
viaMobile: viaMobile
}).then(data => {
this.$emit('posted');