summaryrefslogtreecommitdiff
path: root/packages/frontend/src/components/SkNote.vue
diff options
context:
space:
mode:
authorMar0xy <marie@kaifa.ch>2023-12-04 00:19:34 +0100
committerMar0xy <marie@kaifa.ch>2023-12-04 00:19:34 +0100
commitfb75282ea8c71fd4dfc08c885fe099f2f1e2baba (patch)
treeb0d1850acb55c3122f81e7f41dc4c0a01f0d5c66 /packages/frontend/src/components/SkNote.vue
parentfix: quotes showing in replies on a note (diff)
downloadsharkey-fb75282ea8c71fd4dfc08c885fe099f2f1e2baba.tar.gz
sharkey-fb75282ea8c71fd4dfc08c885fe099f2f1e2baba.tar.bz2
sharkey-fb75282ea8c71fd4dfc08c885fe099f2f1e2baba.zip
add: choose boost visibility when clicking boost
Closes transfem-org/Sharkey#195
Diffstat (limited to 'packages/frontend/src/components/SkNote.vue')
-rw-r--r--packages/frontend/src/components/SkNote.vue51
1 files changed, 43 insertions, 8 deletions
diff --git a/packages/frontend/src/components/SkNote.vue b/packages/frontend/src/components/SkNote.vue
index 349304db45..5bad52040e 100644
--- a/packages/frontend/src/components/SkNote.vue
+++ b/packages/frontend/src/components/SkNote.vue
@@ -116,7 +116,7 @@ SPDX-License-Identifier: AGPL-3.0-only
class="_button"
:style="renoted ? 'color: var(--accent) !important;' : ''"
v-on:click.stop
- @mousedown="renoted ? undoRenote(appearNote) : renote()"
+ @mousedown="renoted ? undoRenote(appearNote) : boostVisibility()"
>
<i class="ph-rocket-launch ph-bold ph-lg"></i>
<p v-if="appearNote.renoteCount > 0" :class="$style.footerButtonCount">{{ appearNote.renoteCount }}</p>
@@ -380,7 +380,43 @@ function smallerVisibility(a: Visibility | string, b: Visibility | string): Visi
return 'public';
}
-function renote() {
+function boostVisibility() {
+ os.popupMenu([
+ {
+ type: 'button',
+ icon: 'ph-globe-hemisphere-west ph-bold ph-lg',
+ text: i18n.ts._visibility['public'],
+ action: () => {
+ renote('public');
+ },
+ },
+ {
+ type: 'button',
+ icon: 'ph-house ph-bold ph-lg',
+ text: i18n.ts._visibility['home'],
+ action: () => {
+ renote('home');
+ },
+ },
+ {
+ type: 'button',
+ icon: 'ph-lock ph-bold ph-lg',
+ text: i18n.ts._visibility['followers'],
+ action: () => {
+ renote('followers');
+ },
+ },
+ {
+ type: 'button',
+ icon: 'ph-planet ph-bold ph-lg',
+ text: i18n.ts._timelines.local,
+ action: () => {
+ renote('local');
+ },
+ }], renoteButton.value);
+}
+
+function renote(visibility: Visibility | 'local') {
pleaseLogin();
showMovedDialog();
@@ -412,18 +448,17 @@ function renote() {
}
const configuredVisibility = defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility;
- const localOnly = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
+ const localOnlySetting = defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly;
- let visibility = appearNote.visibility;
- visibility = smallerVisibility(visibility, configuredVisibility);
+ let noteVisibility = visibility === 'local' ? smallerVisibility(appearNote.visibility, configuredVisibility) : smallerVisibility(visibility, configuredVisibility);
if (appearNote.channel?.isSensitive) {
- visibility = smallerVisibility(visibility, 'home');
+ noteVisibility = smallerVisibility(visibility === 'local' ? appearNote.visibility : visibility, 'home');
}
if (!props.mock) {
os.api('notes/create', {
- localOnly,
- visibility,
+ localOnly: visibility === 'local' ? true : localOnlySetting,
+ visibility: noteVisibility,
renoteId: appearNote.id,
}).then(() => {
os.toast(i18n.ts.renoted);