To able to store local only visibilities (#3298)
This commit is contained in:
parent
6c72545fc8
commit
35db61f1b4
|
@ -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')
|
||||
|
|
|
@ -85,6 +85,9 @@
|
|||
<option value="followers">{{ $t('@.note-visibility.followers') }}</option>
|
||||
<option value="specified">{{ $t('@.note-visibility.specified') }}</option>
|
||||
<option value="private">{{ $t('@.note-visibility.private') }}</option>
|
||||
<option value="local-public">{{ $t('@.note-visibility.local-public') }}</option>
|
||||
<option value="local-home">{{ $t('@.note-visibility.local-home') }}</option>
|
||||
<option value="local-followers">{{ $t('@.note-visibility.local-followers') }}</option>
|
||||
</ui-select>
|
||||
</section>
|
||||
</section>
|
||||
|
|
|
@ -100,7 +100,7 @@ export default Vue.extend({
|
|||
files: [],
|
||||
poll: false,
|
||||
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,
|
||||
useCw: false,
|
||||
|
@ -184,6 +184,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;
|
||||
|
@ -275,26 +278,19 @@ export default Vue.extend({
|
|||
compact: true
|
||||
});
|
||||
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);
|
||||
});
|
||||
},
|
||||
|
||||
addVisibleUser() {
|
||||
this.$input({
|
||||
title: this.$t('username-prompt')
|
||||
}).then(acct => {
|
||||
if (acct.startsWith('@')) acct = acct.substr(1);
|
||||
this.$root.api('users/show', parseAcct(acct)).then(user => {
|
||||
this.visibleUsers.push(user);
|
||||
});
|
||||
});
|
||||
applyVisibility(v :string) {
|
||||
const m = v.match(/^local-(.+)/);
|
||||
if (m) {
|
||||
this.localOnly = true;
|
||||
this.visibility = m[1];
|
||||
} else {
|
||||
this.localOnly = false;
|
||||
this.visibility = v;
|
||||
}
|
||||
},
|
||||
|
||||
removeVisibleUser(user) {
|
||||
|
|
|
@ -80,6 +80,9 @@
|
|||
<option value="followers">{{ $t('@.note-visibility.followers') }}</option>
|
||||
<option value="specified">{{ $t('@.note-visibility.specified') }}</option>
|
||||
<option value="private">{{ $t('@.note-visibility.private') }}</option>
|
||||
<option value="local-public">{{ $t('@.note-visibility.local-public') }}</option>
|
||||
<option value="local-home">{{ $t('@.note-visibility.local-home') }}</option>
|
||||
<option value="local-followers">{{ $t('@.note-visibility.local-followers') }}</option>
|
||||
</ui-select>
|
||||
</section>
|
||||
</section>
|
||||
|
|
Loading…
Reference in a new issue