upd: remove quote button restriction and coloring

This commit is contained in:
Mar0xy 2023-11-29 22:26:10 +01:00
parent 264062258b
commit 363bb43658
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
3 changed files with 3 additions and 96 deletions

View file

@ -127,9 +127,8 @@ SPDX-License-Identifier: AGPL-3.0-only
ref="quoteButton"
:class="$style.footerButton"
class="_button"
:style="quoted ? 'color: var(--accent) !important;' : ''"
v-on:click.stop
@mousedown="quoted ? undoQuote(appearNote) : quote()"
@mousedown="quote()"
>
<i class="ph-quotes ph-bold ph-lg"></i>
</button>
@ -281,7 +280,6 @@ const isLong = shouldCollapsed(appearNote, urls ?? []);
const collapsed = ref(appearNote.cw == null && isLong);
const isDeleted = ref(false);
const renoted = ref(false);
const quoted = ref(false);
const muted = ref($i ? checkWordMute(appearNote, $i, $i.mutedWords) : false);
const translation = ref<any>(null);
const translating = ref(false);
@ -367,15 +365,6 @@ if (!props.mock) {
}).then((res) => {
renoted.value = res.length > 0;
});
os.api("notes/renotes", {
noteId: appearNote.id,
userId: $i.id,
limit: 1,
quote: true,
}).then((res) => {
quoted.value = res.length > 0;
});
}
}
@ -470,7 +459,6 @@ function quote() {
os.popup(MkRippleEffect, { x, y }, {}, 'end');
}
quoted.value = res.length > 0;
os.toast(i18n.ts.quoted);
});
});
@ -493,7 +481,6 @@ function quote() {
os.popup(MkRippleEffect, { x, y }, {}, 'end');
}
quoted.value = res.length > 0;
os.toast(i18n.ts.quoted);
});
});
@ -606,26 +593,6 @@ function undoRenote(note) : void {
}
}
function undoQuote(note) : void {
if (props.mock) {
return;
}
os.api("notes/unrenote", {
noteId: note.id,
quote: true
});
os.toast(i18n.ts.rmquote);
quoted.value = false;
const el = quoteButton.value as HTMLElement | null | undefined;
if (el) {
const rect = el.getBoundingClientRect();
const x = rect.left + (el.offsetWidth / 2);
const y = rect.top + (el.offsetHeight / 2);
os.popup(MkRippleEffect, { x, y }, {}, 'end');
}
}
function onContextmenu(ev: MouseEvent): void {
if (props.mock) {
return;