mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-04 07:24:13 +00:00 
			
		
		
		
	
							parent
							
								
									7045547e46
								
							
						
					
					
						commit
						c9819babfe
					
				
					 2 changed files with 9 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
 | 
			
		|||
 | 
			
		||||
<template>
 | 
			
		||||
<div :class="$style.noteEmbedRoot">
 | 
			
		||||
	<EmNoteDetailed v-if="note" :note="note"/>
 | 
			
		||||
	<EmNoteDetailed v-if="note && !prohibited" :note="note"/>
 | 
			
		||||
	<XNotFound v-else/>
 | 
			
		||||
</div>
 | 
			
		||||
</template>
 | 
			
		||||
| 
						 | 
				
			
			@ -27,6 +27,8 @@ const serverContext = inject(DI.serverContext)!;
 | 
			
		|||
 | 
			
		||||
const note = ref<Misskey.entities.Note | null>(null);
 | 
			
		||||
 | 
			
		||||
const prohibited = ref(false);
 | 
			
		||||
 | 
			
		||||
if (assertServerContext(serverContext, 'note')) {
 | 
			
		||||
	note.value = serverContext.note;
 | 
			
		||||
} else {
 | 
			
		||||
| 
						 | 
				
			
			@ -36,6 +38,11 @@ if (assertServerContext(serverContext, 'note')) {
 | 
			
		|||
		return null;
 | 
			
		||||
	});
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
if (note.value?.url != null || note.value?.uri != null) {
 | 
			
		||||
	// リモートサーバーのノートは弾く
 | 
			
		||||
	prohibited.value = true;
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" module>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -18,6 +18,6 @@ export const userPage = (user: Misskey.Acct, path?: string, absolute = false) =>
 | 
			
		|||
	return `${absolute ? url : ''}/@${acct(user)}${(path ? `/${path}` : '')}`;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export const notePage = note => {
 | 
			
		||||
export const notePage = (note: Misskey.entities.Note) => {
 | 
			
		||||
	return `/notes/${note.id}`;
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue