summaryrefslogtreecommitdiff
path: root/src/client/app/common/scripts/post-form.ts
diff options
context:
space:
mode:
authorSatsuki Yanagi <17376330+u1-liquid@users.noreply.github.com>2019-08-25 16:12:01 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2019-08-25 16:12:01 +0900
commit1c4e1af7c3951bf935f7d9e7ce607a77faabe441 (patch)
tree78e70628894a1ca39bdd5003c8fc61235a6ee4db /src/client/app/common/scripts/post-form.ts
parentResolve #2716 (#5340) (diff)
downloadsharkey-1c4e1af7c3951bf935f7d9e7ce607a77faabe441.tar.gz
sharkey-1c4e1af7c3951bf935f7d9e7ce607a77faabe441.tar.bz2
sharkey-1c4e1af7c3951bf935f7d9e7ce607a77faabe441.zip
Improve post form (#5326)
* Improve post form * Remove local icon from button
Diffstat (limited to 'src/client/app/common/scripts/post-form.ts')
-rw-r--r--src/client/app/common/scripts/post-form.ts21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/client/app/common/scripts/post-form.ts b/src/client/app/common/scripts/post-form.ts
index 2b591ac659..9b155f7fcb 100644
--- a/src/client/app/common/scripts/post-form.ts
+++ b/src/client/app/common/scripts/post-form.ts
@@ -153,6 +153,10 @@ export default (opts) => ({
// デフォルト公開範囲
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 && this.reply.localOnly) {
+ this.localOnly = true;
+ }
+
// 公開以外へのリプライ時は元の公開範囲を引き継ぐ
if (this.reply && ['home', 'followers', 'specified'].includes(this.reply.visibility)) {
this.visibility = this.reply.visibility;
@@ -162,13 +166,13 @@ export default (opts) => ({
}).then(users => {
this.visibleUsers.push(...users);
});
- }
- }
- if (this.reply && this.reply.userId !== this.$store.state.i.id) {
- this.$root.api('users/show', { userId: this.reply.userId }).then(user => {
- this.visibleUsers.push(user);
- });
+ if (this.reply.userId !== this.$store.state.i.id) {
+ this.$root.api('users/show', { userId: this.reply.userId }).then(user => {
+ this.visibleUsers.push(user);
+ });
+ }
+ }
}
// keep cw when reply
@@ -199,8 +203,9 @@ export default (opts) => ({
this.$emit('change-attached-files', this.files);
}
}
+
+ // 削除して編集
if (this.initialNote) {
- // 削除して編集
const init = this.initialNote;
this.text = init.text ? init.text : '';
this.files = init.files;
@@ -318,7 +323,7 @@ export default (opts) => ({
setVisibility() {
const w = this.$root.new(MkVisibilityChooser, {
source: this.$refs.visibilityButton,
- currentVisibility: this.visibility
+ currentVisibility: this.localOnly ? `local-${this.visibility}` : this.visibility
});
w.$once('chosen', v => {
this.applyVisibility(v);