mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	move tooltip message to computed
This commit is contained in:
		
							parent
							
								
									2c90eebe86
								
							
						
					
					
						commit
						3717654309
					
				
					 6 changed files with 36 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -128,7 +128,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		|||
				<button
 | 
			
		||||
					v-if="canRenote"
 | 
			
		||||
					ref="renoteButton"
 | 
			
		||||
					v-tooltip="renoted ? i18n.ts.unrenote : (!defaultStore.state.showVisibilitySelectorOnBoost ? i18n.ts.renoteShift : i18n.ts.renote)"
 | 
			
		||||
					v-tooltip="renoteTooltip"
 | 
			
		||||
					:class="$style.footerButton"
 | 
			
		||||
					class="_button"
 | 
			
		||||
					:style="renoted ? 'color: var(--MI_THEME-accent) !important;' : ''"
 | 
			
		||||
| 
						 | 
				
			
			@ -339,6 +339,11 @@ const pleaseLoginContext = computed<OpenOnRemoteOptions>(() => ({
 | 
			
		|||
	url: `https://${host}/notes/${appearNote.value.id}`,
 | 
			
		||||
}));
 | 
			
		||||
 | 
			
		||||
const renoteTooltip = computed(() => {
 | 
			
		||||
	if (renoted.value) return i18n.ts.unrenote;
 | 
			
		||||
	return defaultStore.state.showVisibilitySelectorOnBoost ? i18n.ts.renote : i18n.ts.renoteShift;
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
/* Overload FunctionにLintが対応していないのでコメントアウト
 | 
			
		||||
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly: true): boolean;
 | 
			
		||||
function checkMute(noteToCheck: Misskey.entities.Note, mutedWords: Array<string | string[]> | undefined | null, checkOnly: false): boolean | 'sensitiveMute';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -140,7 +140,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		|||
			<button
 | 
			
		||||
				v-if="canRenote"
 | 
			
		||||
				ref="renoteButton"
 | 
			
		||||
				v-tooltip="renoted ? i18n.ts.unrenote : (!defaultStore.state.showVisibilitySelectorOnBoost ? i18n.ts.renoteShift : i18n.ts.renote)"
 | 
			
		||||
				v-tooltip="renoteTooltip"
 | 
			
		||||
				class="_button"
 | 
			
		||||
				:class="$style.noteFooterButton"
 | 
			
		||||
				:style="renoted ? 'color: var(--MI_THEME-accent) !important;' : ''"
 | 
			
		||||
| 
						 | 
				
			
			@ -348,6 +348,11 @@ const quotes = ref<Misskey.entities.Note[]>([]);
 | 
			
		|||
const canRenote = computed(() => ['public', 'home'].includes(appearNote.value.visibility) || (appearNote.value.visibility === 'followers' && appearNote.value.userId === $i?.id));
 | 
			
		||||
const defaultLike = computed(() => defaultStore.state.like ? defaultStore.state.like : null);
 | 
			
		||||
 | 
			
		||||
const renoteTooltip = computed(() => {
 | 
			
		||||
	if (renoted.value) return i18n.ts.unrenote;
 | 
			
		||||
	return defaultStore.state.showVisibilitySelectorOnBoost ? i18n.ts.renote : i18n.ts.renoteShift;
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
watch(() => props.expandAllCws, (expandAllCws) => {
 | 
			
		||||
	if (expandAllCws !== showContent.value) showContent.value = expandAllCws;
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -28,7 +28,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		|||
				<button
 | 
			
		||||
					v-if="canRenote"
 | 
			
		||||
					ref="renoteButton"
 | 
			
		||||
					v-tooltip="renoted ? i18n.ts.unrenote : (!defaultStore.state.showVisibilitySelectorOnBoost ? i18n.ts.renoteShift : i18n.ts.renote)"
 | 
			
		||||
					v-tooltip="renoteTooltip"
 | 
			
		||||
					class="_button"
 | 
			
		||||
					:class="$style.noteFooterButton"
 | 
			
		||||
					:style="renoted ? 'color: var(--MI_THEME-accent) !important;' : ''"
 | 
			
		||||
| 
						 | 
				
			
			@ -136,6 +136,11 @@ const quoteButton = shallowRef<HTMLElement>();
 | 
			
		|||
const menuButton = shallowRef<HTMLElement>();
 | 
			
		||||
const likeButton = shallowRef<HTMLElement>();
 | 
			
		||||
 | 
			
		||||
const renoteTooltip = computed(() => {
 | 
			
		||||
	if (renoted.value) return i18n.ts.unrenote;
 | 
			
		||||
	return defaultStore.state.showVisibilitySelectorOnBoost ? i18n.ts.renote : i18n.ts.renoteShift;
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
let appearNote = computed(() => isRenote ? props.note.renote as Misskey.entities.Note : props.note);
 | 
			
		||||
const defaultLike = computed(() => defaultStore.state.like ? defaultStore.state.like : null);
 | 
			
		||||
const replies = ref<Misskey.entities.Note[]>([]);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -129,7 +129,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		|||
				<button
 | 
			
		||||
					v-if="canRenote"
 | 
			
		||||
					ref="renoteButton"
 | 
			
		||||
					v-tooltip="renoted ? i18n.ts.unrenote : (!defaultStore.state.showVisibilitySelectorOnBoost ? i18n.ts.renoteShift : i18n.ts.renote)"
 | 
			
		||||
					v-tooltip="renoteTooltip"
 | 
			
		||||
					:class="$style.footerButton"
 | 
			
		||||
					class="_button"
 | 
			
		||||
					:style="renoted ? 'color: var(--MI_THEME-accent) !important;' : ''"
 | 
			
		||||
| 
						 | 
				
			
			@ -334,6 +334,11 @@ const defaultLike = computed(() => defaultStore.state.like ? defaultStore.state.
 | 
			
		|||
const animated = computed(() => parsed.value ? checkAnimationFromMfm(parsed.value) : null);
 | 
			
		||||
const allowAnim = ref(defaultStore.state.advancedMfm && defaultStore.state.animatedMfm ? true : false);
 | 
			
		||||
 | 
			
		||||
const renoteTooltip = computed(() => {
 | 
			
		||||
	if (renoted.value) return i18n.ts.unrenote;
 | 
			
		||||
	return defaultStore.state.showVisibilitySelectorOnBoost ? i18n.ts.renote : i18n.ts.renoteShift;
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const pleaseLoginContext = computed<OpenOnRemoteOptions>(() => ({
 | 
			
		||||
	type: 'lookup',
 | 
			
		||||
	url: `https://${host}/notes/${appearNote.value.id}`,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -145,7 +145,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		|||
			<button
 | 
			
		||||
				v-if="canRenote"
 | 
			
		||||
				ref="renoteButton"
 | 
			
		||||
				v-tooltip="renoted ? i18n.ts.unrenote : (!defaultStore.state.showVisibilitySelectorOnBoost ? i18n.ts.renoteShift : i18n.ts.renote)"
 | 
			
		||||
				v-tooltip="renoteTooltip"
 | 
			
		||||
				class="_button"
 | 
			
		||||
				:class="$style.noteFooterButton"
 | 
			
		||||
				:style="renoted ? 'color: var(--MI_THEME-accent) !important;' : ''"
 | 
			
		||||
| 
						 | 
				
			
			@ -354,6 +354,11 @@ const quotes = ref<Misskey.entities.Note[]>([]);
 | 
			
		|||
const canRenote = computed(() => ['public', 'home'].includes(appearNote.value.visibility) || (appearNote.value.visibility === 'followers' && appearNote.value.userId === $i?.id));
 | 
			
		||||
const defaultLike = computed(() => defaultStore.state.like ? defaultStore.state.like : null);
 | 
			
		||||
 | 
			
		||||
const renoteTooltip = computed(() => {
 | 
			
		||||
	if (renoted.value) return i18n.ts.unrenote;
 | 
			
		||||
	return defaultStore.state.showVisibilitySelectorOnBoost ? i18n.ts.renote : i18n.ts.renoteShift;
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
watch(() => props.expandAllCws, (expandAllCws) => {
 | 
			
		||||
	if (expandAllCws !== showContent.value) showContent.value = expandAllCws;
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -36,7 +36,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		|||
				<button
 | 
			
		||||
					v-if="canRenote"
 | 
			
		||||
					ref="renoteButton"
 | 
			
		||||
					v-tooltip="renoted ? i18n.ts.unrenote : (!defaultStore.state.showVisibilitySelectorOnBoost ? i18n.ts.renoteShift : i18n.ts.renote)"
 | 
			
		||||
					v-tooltip="renoteTooltip"
 | 
			
		||||
					class="_button"
 | 
			
		||||
					:class="$style.noteFooterButton"
 | 
			
		||||
					:style="renoted ? 'color: var(--MI_THEME-accent) !important;' : ''"
 | 
			
		||||
| 
						 | 
				
			
			@ -150,6 +150,11 @@ const quoteButton = shallowRef<HTMLElement>();
 | 
			
		|||
const menuButton = shallowRef<HTMLElement>();
 | 
			
		||||
const likeButton = shallowRef<HTMLElement>();
 | 
			
		||||
 | 
			
		||||
const renoteTooltip = computed(() => {
 | 
			
		||||
	if (renoted.value) return i18n.ts.unrenote;
 | 
			
		||||
	return defaultStore.state.showVisibilitySelectorOnBoost ? i18n.ts.renote : i18n.ts.renoteShift;
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
let appearNote = computed(() => isRenote ? props.note.renote as Misskey.entities.Note : props.note);
 | 
			
		||||
const defaultLike = computed(() => defaultStore.state.like ? defaultStore.state.like : null);
 | 
			
		||||
const replies = ref<Misskey.entities.Note[]>([]);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue